2013-06-18 17:48:41 +02:00
|
|
|
package ebiten
|
|
|
|
|
|
|
|
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
|
|
|
// TODO: Remove this
|
2013-07-05 14:02:17 +02:00
|
|
|
type GameContext interface {
|
2013-10-09 16:34:11 +02:00
|
|
|
ScreenWidth() int
|
|
|
|
ScreenHeight() int
|
2013-06-19 02:36:57 +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 UIEvents interface {
|
|
|
|
ScreenSizeUpdated() <-chan ScreenSizeUpdatedEvent
|
|
|
|
}
|
|
|
|
|
|
|
|
type UI interface {
|
|
|
|
PollEvents()
|
|
|
|
InitTextures(func(graphics.TextureFactory))
|
|
|
|
Draw(func(graphics.Canvas))
|
|
|
|
|
|
|
|
InputStateUpdated() <-chan InputStateUpdatedEvent
|
|
|
|
|
|
|
|
// TODO: Remove this
|
|
|
|
Update(func(GameContext))
|
|
|
|
}
|