2013-12-02 16:15:01 +01:00
|
|
|
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
|
|
|
|
2013-12-01 13:23:03 +01:00
|
|
|
type UIEvents interface {
|
2013-12-03 14:14:51 +01:00
|
|
|
ScreenSizeUpdated() <-chan ScreenSizeUpdatedEvent
|
|
|
|
InputStateUpdated() <-chan InputStateUpdatedEvent
|
2013-12-01 13:23:03 +01:00
|
|
|
}
|
|
|
|
|
2013-11-29 19:21:10 +01:00
|
|
|
type UI interface {
|
|
|
|
PollEvents()
|
2013-12-02 16:15:01 +01:00
|
|
|
LoadResources(func(graphics.TextureFactory))
|
2013-11-29 19:21:10 +01:00
|
|
|
Draw(func(graphics.Canvas))
|
2013-12-01 13:23:03 +01:00
|
|
|
UIEvents
|
2013-11-29 19:21:10 +01:00
|
|
|
}
|