mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-27 04:08:53 +01:00
50 lines
629 B
Go
50 lines
629 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 {
|
|
CreateGameWindow(screenWidth, screenHeight, screenScale int, title string) GameWindow
|
|
Start()
|
|
DoEvents()
|
|
Terminate()
|
|
}
|
|
|
|
type Window interface {
|
|
Events() <-chan interface{}
|
|
}
|
|
|
|
type GameWindow interface {
|
|
Draw(func(graphics.Context))
|
|
Window
|
|
}
|