ui

package
v1.4.0-rc1 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2016 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GLContext added in v1.4.0

func GLContext() *opengl.Context

func Run added in v1.4.0

func Run(width, height int, scale float64, title string, g GraphicsContext, glContext opengl.Context) error

func RunMainThreadLoop added in v1.4.0

func RunMainThreadLoop(ch <-chan error) error

func ScreenScale added in v1.4.0

func ScreenScale() float64

func SetScreenScale added in v1.2.0

func SetScreenScale(scale float64) (bool, error)

func SetScreenSize added in v1.2.0

func SetScreenSize(width, height int) (bool, error)

Types

type GamepadButton added in v1.2.0

type GamepadButton int
const (
	GamepadButton0 GamepadButton = iota
	GamepadButton1
	GamepadButton2
	GamepadButton3
	GamepadButton4
	GamepadButton5
	GamepadButton6
	GamepadButton7
	GamepadButton8
	GamepadButton9
	GamepadButton10
	GamepadButton11
	GamepadButton12
	GamepadButton13
	GamepadButton14
	GamepadButton15
)

type GraphicsContext added in v1.4.0

type GraphicsContext interface {
	SetSize(width, height int, scale float64) error
	Update() error
}

type Input added in v1.3.0

type Input interface {
	IsKeyPressed(key Key) bool
	IsMouseButtonPressed(button MouseButton) bool
	CursorPosition() (x, y int)
	GamepadAxis(id int, axis int) float64
	GamepadAxisNum(id int) int
	GamepadButtonNum(id int) int
	IsGamepadButtonPressed(id int, button GamepadButton) bool
	Touches() []Touch
}

func CurrentInput added in v1.3.0

func CurrentInput() Input

type Key

type Key int
const (
	Key0 Key = iota
	Key1
	Key2
	Key3
	Key4
	Key5
	Key6
	Key7
	Key8
	Key9
	KeyA
	KeyB
	KeyC
	KeyD
	KeyE
	KeyF
	KeyG
	KeyH
	KeyI
	KeyJ
	KeyK
	KeyL
	KeyM
	KeyN
	KeyO
	KeyP
	KeyQ
	KeyR
	KeyS
	KeyT
	KeyU
	KeyV
	KeyW
	KeyX
	KeyY
	KeyZ
	KeyAlt
	KeyBackspace
	KeyCapsLock
	KeyComma
	KeyControl
	KeyDelete
	KeyDown
	KeyEnd
	KeyEnter
	KeyEscape
	KeyF1
	KeyF2
	KeyF3
	KeyF4
	KeyF5
	KeyF6
	KeyF7
	KeyF8
	KeyF9
	KeyF10
	KeyF11
	KeyF12
	KeyHome
	KeyInsert
	KeyLeft
	KeyPageDown
	KeyPageUp
	KeyPeriod
	KeyRight
	KeyShift
	KeySpace
	KeyTab
	KeyUp
)

type MouseButton

type MouseButton int
const (
	MouseButtonLeft MouseButton = iota
	MouseButtonRight
	MouseButtonMiddle
)

type RegularTermination added in v1.4.0

type RegularTermination struct {
}

func (*RegularTermination) Error added in v1.4.0

func (*RegularTermination) Error() string

type Touch added in v1.4.0

type Touch interface {
	ID() int
	Position() (x, y int)
}

Jump to

Keyboard shortcuts

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