Documentation ¶
Index ¶
- Constants
- Variables
- func CancelHover()
- func ClickPos() (m.Pos, bool)
- func Draw(screen *ebiten.Image)
- func DrawEditor(screen *ebiten.Image)
- func EasterEggJustHit() bool
- func ExitPressed()
- func HaveTouch() bool
- func HoverPos() (m.Pos, bool)
- func Init() error
- func KonamiCodeJustHit() bool
- func LoadFromDemo(state *DemoState)
- func SetActionButtonAvailable(avail bool)
- func SetMode(mode Mode)
- func TouchResetEditor()
- func Update(screenWidth, screenHeight, gameWidth, gameHeight int, crtK1, crtK2 float64)
- type ActionButtonID
- type DemoState
- type ExitButtonID
- type ImpulseState
- type InputMap
- type Mode
- type MouseStatus
Constants ¶
View Source
const ( NoInput InputMap = 0 // Allocated input bits. DOSKeyboardWithEscape InputMap = 1 NESKeyboardWithEscape InputMap = 2 FPSKeyboardWithEscape InputMap = 4 ViKeyboardWithEscape InputMap = 8 Gamepad InputMap = 16 DOSKeyboardWithBackspace InputMap = 32 NESKeyboardWithBackspace InputMap = 64 FPSKeyboardWithBackspace InputMap = 128 ViKeyboardWithBackspace InputMap = 256 Touchscreen InputMap = 512 // Computed helpers values. AnyKeyboardWithEscape = DOSKeyboardWithEscape | NESKeyboardWithEscape | FPSKeyboardWithEscape | ViKeyboardWithEscape AnyKeyboardWithBackspace = DOSKeyboardWithBackspace | NESKeyboardWithBackspace | FPSKeyboardWithBackspace | ViKeyboardWithBackspace DOSKeyboard = DOSKeyboardWithEscape | DOSKeyboardWithBackspace NESKeyboard = NESKeyboardWithEscape | NESKeyboardWithBackspace FPSKeyboard = FPSKeyboardWithEscape | FPSKeyboardWithBackspace ViKeyboard = ViKeyboardWithEscape | ViKeyboardWithBackspace AnyKeyboard = AnyKeyboardWithEscape | AnyKeyboardWithBackspace AnyInput = AnyKeyboard | Gamepad | Touchscreen )
Variables ¶
View Source
var ( Left = (&impulse{Name: "Left", keys: leftKeys, padControls: leftPad, touchRect: touchRectLeft}).register() Right = (&impulse{Name: "Right", keys: rightKeys, padControls: rightPad, touchRect: touchRectRight}).register() Up = (&impulse{Name: "Up", keys: upKeys, padControls: upPad, touchRect: touchRectUp}).register() Down = (&impulse{Name: "Down", keys: downKeys, padControls: downPad, touchRect: touchRectDown}).register() Jump = (&impulse{Name: "Jump", keys: jumpKeys, padControls: jumpPad, touchRect: touchRectJump}).register() Action = (&impulse{Name: "Action", keys: actionKeys, padControls: actionPad, touchRect: touchRectAction}).register() Exit = (&impulse{Name: "Exit", keys: exitKeys, padControls: exitPad, mouseControl: true, touchRect: touchRectExit}).register() Fullscreen = (&impulse{Name: "Fullscreen", keys: fullscreenKeys}).register() )
Functions ¶
func CancelHover ¶ added in v1.1.112
func CancelHover()
func DrawEditor ¶ added in v1.3.511
func DrawEditor(screen *ebiten.Image)
func EasterEggJustHit ¶
func EasterEggJustHit() bool
func ExitPressed ¶ added in v1.2.265
func ExitPressed()
func KonamiCodeJustHit ¶ added in v1.1.31
func KonamiCodeJustHit() bool
func LoadFromDemo ¶
func LoadFromDemo(state *DemoState)
func SetActionButtonAvailable ¶ added in v1.3.511
func SetActionButtonAvailable(avail bool)
func TouchResetEditor ¶ added in v1.3.43
func TouchResetEditor()
Types ¶
type ActionButtonID ¶ added in v1.3.263
type ActionButtonID int
const ( BX ActionButtonID = iota Elsewhere B CtrlShift Z ShiftETab EnterShift )
func ActionButton ¶ added in v1.3.263
func ActionButton() ActionButtonID
type DemoState ¶
type DemoState struct { InputMap InputMap `json:",omitempty"` Left *ImpulseState `json:",omitempty"` Right *ImpulseState `json:",omitempty"` Up *ImpulseState `json:",omitempty"` Down *ImpulseState `json:",omitempty"` Jump *ImpulseState `json:",omitempty"` Action *ImpulseState `json:",omitempty"` Exit *ImpulseState `json:",omitempty"` HoverPos *m.Pos `json:",omitempty"` ClickPos *m.Pos `json:",omitempty"` EasterEggJustHit bool `json:",omitempty"` KonamiCodeJustHit bool `json:",omitempty"` }
func SaveToDemo ¶
func SaveToDemo() *DemoState
type ExitButtonID ¶ added in v1.0.59
type ExitButtonID int
const ( Start ExitButtonID = iota Back Escape Backspace )
func ExitButton ¶ added in v1.0.59
func ExitButton() ExitButtonID
type ImpulseState ¶
func (*ImpulseState) Empty ¶
func (i *ImpulseState) Empty() bool
func (*ImpulseState) OrEmpty ¶
func (i *ImpulseState) OrEmpty() ImpulseState
func (*ImpulseState) UnlessEmpty ¶
func (i *ImpulseState) UnlessEmpty() *ImpulseState
type MouseStatus ¶ added in v1.1.112
type MouseStatus int
const ( NoMouse MouseStatus = iota HoveringMouse ClickingMouse )
func Mouse ¶ added in v1.1.112
func Mouse() (m.Pos, MouseStatus)
Click to show internal directories.
Click to hide internal directories.