ebiten/ui/ui.go
2013-12-31 03:17:39 +09:00

48 lines
630 B
Go

package ui
import (
"github.com/hajimehoshi/go-ebiten/graphics"
)
type Key int
const (
KeyUp Key = iota
KeyDown
KeyLeft
KeyRight
KeySpace
KeyMax
)
type WindowSizeUpdatedEvent struct {
Width int
Height int
}
type KeyStateUpdatedEvent struct {
Keys []Key
}
type MouseStateUpdatedEvent struct {
X int
Y int
}
type WindowClosedEvent struct {
}
type UI interface {
PollEvents()
CreateGameWindow(screenWidth, screenHeight, screenScale int, title string) GameWindow
}
type Window interface {
Events() <-chan interface{}
}
type GameWindow interface {
Draw(func(graphics.Context))
Events() <-chan interface{}
}