ebiten/ui/ui.go

31 lines
507 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-11-29 19:21:10 +01:00
type ScreenSizeUpdatedEvent struct {
Width int
Height int
}
type InputStateUpdatedEvent 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
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 WindowEvents interface {
ScreenSizeUpdated() <-chan ScreenSizeUpdatedEvent
InputStateUpdated() <-chan InputStateUpdatedEvent
}
type Window interface {
Draw(func(graphics.Canvas))
WindowEvents
}