Documentation ¶
Index ¶
- type InputHandler
- func (ih *InputHandler) ButtonEvent(button pixel.Button, action pixel.Action)
- func (ih *InputHandler) CharEvent(r rune)
- func (ih *InputHandler) MouseEnteredEvent(entered bool)
- func (ih *InputHandler) MouseMoveEvent(pos pixel.Vec)
- func (ih *InputHandler) MouseScrollEvent(x, y float64)
- func (ih *InputHandler) SetMousePosition(pos pixel.Vec)
- func (ih *InputHandler) Update()
- type InputState
- type JoystickState
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InputHandler ¶
type InputHandler struct {
Prev, Curr InputState
PressEvents [pixel.NumButtons]bool
ReleaseEvents [pixel.NumButtons]bool
MouseInsideWindow bool
// contains filtered or unexported fields
}
func (*InputHandler) ButtonEvent ¶
func (ih *InputHandler) ButtonEvent(button pixel.Button, action pixel.Action)
ButtonEvent sets the action state of a button for the next update
func (*InputHandler) CharEvent ¶
func (ih *InputHandler) CharEvent(r rune)
CharEvent adds to the typed string for the next update
func (*InputHandler) MouseEnteredEvent ¶
func (ih *InputHandler) MouseEnteredEvent(entered bool)
MouseEnteredEvent is called when the mouse enters or leaves the window
func (*InputHandler) MouseMoveEvent ¶
func (ih *InputHandler) MouseMoveEvent(pos pixel.Vec)
MouseMoveEvent sets the mouse position for the next update
func (*InputHandler) MouseScrollEvent ¶
func (ih *InputHandler) MouseScrollEvent(x, y float64)
MouseScrollEvent adds to the scroll offset for the next update
func (*InputHandler) SetMousePosition ¶
func (ih *InputHandler) SetMousePosition(pos pixel.Vec)
SetMousePosition overrides the mouse position Called when the mouse is set to a point in the backend Window
func (*InputHandler) Update ¶
func (ih *InputHandler) Update()
type InputState ¶
type JoystickState ¶
type JoystickState struct { Connected [pixel.NumJoysticks]bool Name [pixel.NumJoysticks]string Buttons [pixel.NumJoysticks][]pixel.Action Axis [pixel.NumJoysticks][]float32 }
func (*JoystickState) GetAxis ¶
func (js *JoystickState) GetAxis(joystick pixel.Joystick, axis pixel.GamepadAxis) float64
Returns the value of a joystick axis, returning 0 if the button or joystick is invalid.
func (*JoystickState) GetButton ¶
func (js *JoystickState) GetButton(joystick pixel.Joystick, button pixel.GamepadButton) bool
Returns if a button on a joystick is down, returning false if the button or joystick is invalid.
Click to show internal directories.
Click to hide internal directories.