ebiten/ui/ui.go
2014-12-07 01:09:59 +09:00

39 lines
510 B
Go

package ui
import (
"github.com/hajimehoshi/ebiten/graphics"
)
type Key int
const (
KeyUp Key = iota
KeyDown
KeyLeft
KeyRight
KeySpace
KeyMax
)
type UI interface {
Start(widht, height, scale int, title string) (Canvas, graphics.TextureFactory)
DoEvents()
Terminate()
}
type Keys interface {
Includes(key Key) bool
}
type InputState interface {
PressedKeys() Keys
MouseX() int
MouseY() int
}
type Canvas interface {
Draw(func(graphics.Context))
IsClosed() bool
InputState() InputState
}