ebiten/ui/ui.go
2014-05-12 10:04:28 +09:00

40 lines
502 B
Go

package ui
import (
"github.com/hajimehoshi/go-ebiten/graphics"
)
type Key int
const (
KeyUp Key = iota
KeyDown
KeyLeft
KeyRight
KeySpace
KeyMax
)
type UI interface {
CreateCanvas(widht, height, scale int, title string) Canvas
Start()
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
}