resources

package
v1.66.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 16, 2024 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	// Combinations contains buttons combinations
	Combinations [][]Button
	// Once determines if the action should be triggered every frame when the button is pressed (default) or only once
	Once bool
}

Action contains buttons combinations with settings

type Axis

type Axis struct {
	Value interface{}
}

Axis can be an emulated axis, a gamepad axis or a mouse axis

func (*Axis) UnmarshalTOML

func (a *Axis) UnmarshalTOML(i interface{}) error

UnmarshalTOML fills structure fields from TOML data

type Button

type Button struct {
	Value interface{}
}

Button can be a US keyboard key, a mouse button or a gamepad button

func (*Button) UnmarshalTOML

func (b *Button) UnmarshalTOML(i interface{}) error

UnmarshalTOML fills structure fields from TOML data

type ButtonResources added in v1.55.0

type ButtonResources struct {
	Image   *widget.ButtonImage
	Text    *widget.ButtonTextColor
	Face    text.Face
	Padding widget.Insets
}

type CheckboxResources added in v1.55.0

type CheckboxResources struct {
	Image   *widget.ButtonImage
	Graphic *widget.CheckboxGraphicImage
	Spacing int
}

type ComboButtonResources added in v1.55.0

type ComboButtonResources struct {
	Image   *widget.ButtonImage
	Text    *widget.ButtonTextColor
	Face    text.Face
	Graphic *widget.ButtonImageImage
	Padding widget.Insets
}

type ControllerAxis

type ControllerAxis struct {
	ID       ebiten.GamepadID
	Axis     int
	Invert   bool
	DeadZone float64 `toml:"dead_zone"`
}

ControllerAxis is a gamepad axis

type ControllerButton

type ControllerButton struct {
	ID            ebiten.GamepadID
	GamepadButton ebiten.GamepadButton
}

ControllerButton is a gamepad button

func (*ControllerButton) UnmarshalTOML

func (b *ControllerButton) UnmarshalTOML(i interface{}) error

UnmarshalTOML fills structure fields from TOML data

type Controls

type Controls struct {
	// Axes contains axis controls, used for inputs represented by a float value from -1 to 1
	Axes map[string]Axis
	// Actions contains buttons combinations, used for general inputs
	Actions map[string]Action
}

Controls contains input controls

type Emulated

type Emulated struct {
	Pos Button
	Neg Button
}

Emulated is an emulated axis

type Font

type Font struct {
	Font       text.Face
	FaceSource *text.GoTextFaceSource // コピーが禁止されていて参照渡ししかできない
}

Font structure

func (*Font) UnmarshalTOML

func (f *Font) UnmarshalTOML(i interface{}) error

UnmarshalTOML fills structure fields from TOML data

type HeaderResources added in v1.55.0

type HeaderResources struct {
	Background *image.NineSlice
	Padding    widget.Insets
	Face       text.Face
	Color      color.Color
}

type InputHandler

type InputHandler struct {
	// Axes contains input axis values
	Axes map[string]float64
	// Actions contains input actions
	Actions map[string]bool
}

InputHandler contains input axis values and actions corresponding to specified controls

type Key

type Key struct {
	Key ebiten.Key
}

Key is a US keyboard key

func (*Key) UnmarshalText

func (k *Key) UnmarshalText(text []byte) error

UnmarshalText fills structure fields from text data

type LabelResources added in v1.55.0

type LabelResources struct {
	Text *widget.LabelColor
	Face text.Face
}

type ListResources added in v1.55.0

type ListResources struct {
	Image        *widget.ScrollContainerImage
	ImageTrans   *widget.ScrollContainerImage
	Track        *widget.SliderTrackImage
	TrackPadding widget.Insets
	Handle       *widget.ButtonImage
	HandleSize   int
	Face         text.Face
	Entry        *widget.ListEntryColor
	EntryPadding widget.Insets
}

type MouseAxis

type MouseAxis struct {
	Axis int
}

MouseAxis is a mouse axis

type MouseButton

type MouseButton struct {
	MouseButton ebiten.MouseButton
}

MouseButton is a mouse button

func (*MouseButton) UnmarshalText

func (b *MouseButton) UnmarshalText(text []byte) error

UnmarshalText fills structure fields from text data

type PanelResources added in v1.55.0

type PanelResources struct {
	Image      *image.NineSlice
	ImageTrans *image.NineSlice
	TitleBar   *image.NineSlice
	Padding    widget.Insets
}

type ProgressBarResources added in v1.55.0

type ProgressBarResources struct {
	TrackImage *widget.ProgressBarImage
	FillImage  *widget.ProgressBarImage
}

type Resources

type Resources struct {
	ScreenDimensions *ScreenDimensions
	Controls         *Controls
	InputHandler     *InputHandler
	SpriteSheets     *map[string]components.SpriteSheet
	Fonts            *map[string]Font
	DefaultFaces     *map[string]text.Face
	AudioContext     *audio.Context
	AudioPlayers     *map[string]*audio.Player
	Prefabs          interface{}
	Game             interface{}
	RawMaster        interface{}
	UIResources      *UIResources
}

Resources contains references to data not related to any entity

func InitResources

func InitResources() *Resources

InitResources initializes resources

type ScreenDimensions

type ScreenDimensions struct {
	Width  int
	Height int
}

ScreenDimensions contains current screen dimensions

type SliderResources added in v1.55.0

type SliderResources struct {
	TrackImage *widget.SliderTrackImage
	Handle     *widget.ButtonImage
	HandleSize int
}

type TabBookResources added in v1.55.0

type TabBookResources struct {
	ButtonFace    text.Face
	ButtonText    *widget.ButtonTextColor
	ButtonPadding widget.Insets
}

type TextAreaResources added in v1.55.0

type TextAreaResources struct {
	Image        *widget.ScrollContainerImage
	Track        *widget.SliderTrackImage
	TrackPadding widget.Insets
	Handle       *widget.ButtonImage
	HandleSize   int
	Face         text.Face
	EntryPadding widget.Insets
}

type TextInputResources added in v1.55.0

type TextInputResources struct {
	Image   *widget.TextInputImage
	Padding widget.Insets
	Face    text.Face
	Color   *widget.TextInputColor
}

type TextResources added in v1.55.0

type TextResources struct {
	IdleColor     color.Color
	DisabledColor color.Color
	Face          text.Face
	TitleFace     text.Face
	BigTitleFace  text.Face
	SmallFace     text.Face
}

type ToolTipResources added in v1.55.0

type ToolTipResources struct {
	Background *image.NineSlice
	Padding    widget.Insets
	Face       text.Face
	Color      color.Color
}

type UIResources added in v1.55.0

type UIResources struct {
	Fonts *fonts

	Background *image.NineSlice

	SeparatorColor color.Color

	Text        *TextResources
	Button      *ButtonResources
	Label       *LabelResources
	Checkbox    *CheckboxResources
	ComboButton *ComboButtonResources
	List        *ListResources
	Slider      *SliderResources
	ProgressBar *ProgressBarResources
	Panel       *PanelResources
	TabBook     *TabBookResources
	Header      *HeaderResources
	TextInput   *TextInputResources
	TextArea    *TextAreaResources
	ToolTip     *ToolTipResources
}

func NewUIResources added in v1.55.0

func NewUIResources(tfs *text.GoTextFaceSource) (*UIResources, error)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL