Documentation ¶
Index ¶
Constants ¶
View Source
const ( MouseButtonLeft = MouseButton(iota) MouseButtonRight MouseButtonMiddle )
View Source
const ( WindowClosed = WindowEvent(iota) WindowFocused WindowUnfocused )
View Source
const ( DefaultWidth = 640 DefaultHeight = 480 DefaultDepth = 16 )
View Source
const ( Windowed = ScreenMode(iota + 1) Fullscreen Borderless )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Input ¶
type Input interface { // InputTick runs input event processing, triggering all relevant callback functions. InputTick() // ReplaceInputs replaces all inputs by a provided configuration, and returns the previous configuration. ReplaceInputs(InputConfig) InputConfig // OnInput adds a handler function that will be called on each input event. OnInput(fnc func(ev InputEvent)) // SetTextInput enables or disables text input mode. SetTextInput(enable bool) }
type InputConfig ¶
type InputConfig []func(ev InputEvent)
type InputEvent ¶
type InputEvent interface {
// contains filtered or unexported methods
}
type KeyboardEvent ¶
type MouseButton ¶
type MouseButton int
type MouseButtonEvent ¶
type MouseButtonEvent struct { Button MouseButton Pressed bool }
type MouseWheelEvent ¶
type MouseWheelEvent struct {
Wheel int
}
type Screen ¶
type Screen interface { // ScreenSize returns current size of the screen. ScreenSize() image.Point // ScreenMaxSize returns max size of the screen. ScreenMaxSize() image.Point // ResizeScreen changes the size of the screen. ResizeScreen(sz image.Point) // SetScreenMode changes the screen mode. Fullscreen will maximize the screen to max, while Windowed will return // is back to the previous state. SetScreenMode(mode ScreenMode) // SetGamma sets screen gamma parameter. SetGamma(v float32) // OnScreenResize adds a handler function that will be called on screen resize. OnScreenResize(fnc func(sz image.Point)) // NewSurface creates a new screen surface. NewSurface(sz image.Point, filter bool) Surface // Clear the screen. Clear() // Present the current buffer to the screen. Present() }
type ScreenMode ¶
type ScreenMode int
type TextEditEvent ¶
type TextEditEvent struct {
Text string
}
type TextInputEvent ¶
type TextInputEvent struct {
Text string
}
type WindowEvent ¶
type WindowEvent int
Click to show internal directories.
Click to hide internal directories.