ebiten/ui/ui.go

43 lines
554 B
Go
Raw Normal View History

package ui
2013-06-18 17:48:41 +02:00
import (
2013-10-14 04:34:58 +02:00
"github.com/hajimehoshi/go-ebiten/graphics"
2013-06-18 17:48:41 +02:00
)
2013-12-15 17:13:18 +01:00
type Key int
const (
KeyUp Key = iota
KeyDown
KeyLeft
KeyRight
2013-12-18 10:05:28 +01:00
KeySpace
2013-12-15 17:13:18 +01:00
)
2013-12-18 10:05:28 +01:00
type WindowSizeUpdatedEvent struct {
2013-11-29 19:21:10 +01:00
Width int
Height int
}
2013-12-15 17:13:18 +01:00
type KeyStateUpdatedEvent struct {
Keys []Key
}
type MouseStateUpdatedEvent struct {
2013-07-04 16:57:53 +02:00
X int
Y int
2013-06-25 03:27:32 +02:00
}
2013-11-29 19:21:10 +01:00
2013-12-10 16:49:30 +01:00
type WindowClosedEvent struct {
}
2013-11-29 19:21:10 +01:00
type UI interface {
PollEvents()
2013-12-10 16:18:08 +01:00
CreateWindow(screenWidth, screenHeight, screenScale int, title string) Window
2013-11-29 19:21:10 +01:00
}
2013-12-09 14:40:54 +01:00
type Window interface {
2013-12-13 22:10:24 +01:00
Draw(func(graphics.Context))
2013-12-16 01:39:49 +01:00
Events() <-chan interface{}
2013-12-09 14:40:54 +01:00
}