Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
var SelectColor = color.RGBA{0, 148, 255, 255}
Functions ¶
This section is empty.
Types ¶
type Direction ¶
type Direction int
Direction is the direction for the pad.
const ( // None describes that no direction buttons are pressed. None Direction = iota // Left is left direction Left // Right is right direction. Right // Upper is the upper direction. Upper // UpperLeft is the upper left direction UpperLeft // UpperRight is the upper right direction UpperRight // Lower is the lower direction. Lower // LowerLeft is the lower left direction LowerLeft // LowerRight is the lower right direction LowerRight )
type DirectionalPad ¶
type DirectionalPad struct {
// contains filtered or unexported fields
}
DirectionalPad is the directional pad for a game.
func NewDirectionalPad ¶
func NewDirectionalPad(pad, button *ebiten.Image, cl color.RGBA) DirectionalPad
NewDirectionalPad returns a new DirectionalPad.
func (*DirectionalPad) Draw ¶
func (dp *DirectionalPad) Draw(screen *ebiten.Image)
Draw draws the directional buttons belong this struct.
func (*DirectionalPad) GetDirection ¶
func (dp *DirectionalPad) GetDirection() Direction
GetDirection returns the currently selected direction.
func (*DirectionalPad) SetLocation ¶
func (dp *DirectionalPad) SetLocation(x, y int)
SetLocation sets the location to draw this directional pad.
func (*DirectionalPad) Update ¶
func (dp *DirectionalPad) Update()
Update updates the internal status of this struct.
type SelectButton ¶ added in v0.3.0
type SelectButton interface { SetLocation(x, y int) Update() IsSelected() bool Draw(screen *ebiten.Image) SetSelectState(selected bool) SetSelectKeys(keys []ebiten.Key) SetSelectImage(img *ebiten.Image) }
func NewSelectButton ¶ added in v0.3.0
func NewSelectButton(img *ebiten.Image, tt TriggerType, cl color.RGBA) SelectButton
NewSelectButton returns a new SelectButton. Argument 'TriggerType' specifies the operation for which this button will be selected. Only 'JustReleased' and 'JustPressed' are available. If you specify others, this func returns nil.
type TriggerButton ¶
type TriggerButton interface { SetLocation(x, y int) Update() IsTriggered() bool Draw(screen *ebiten.Image) SetTriggerButton(keys []ebiten.Key) }
func NewTriggerButton ¶
func NewTriggerButton(img *ebiten.Image, tt TriggerType, cl color.RGBA) TriggerButton
NewTriggerButton returns a new TriggerButton.
type TriggerType ¶
type TriggerType int
TriggerType is the type for the TriggerButton.
const ( // JustReleased is triggered only when just released. JustReleased TriggerType = iota // Pressing is triggered while this is being pressed. Pressing // JustPressed is triggered only when just pressed. JustPressed )