mirror of
https://github.com/hajimehoshi/ebiten.git
synced 2024-12-26 03:38:55 +01:00
35 lines
583 B
Go
35 lines
583 B
Go
package ui
|
|
|
|
import (
|
|
"github.com/hajimehoshi/go-ebiten/graphics"
|
|
)
|
|
|
|
type ScreenSizeUpdatedEvent struct {
|
|
Width int
|
|
Height int
|
|
}
|
|
|
|
type InputStateUpdatedEvent struct {
|
|
X int
|
|
Y int
|
|
}
|
|
|
|
type WindowClosedEvent struct {
|
|
}
|
|
|
|
type UI interface {
|
|
PollEvents()
|
|
CreateWindow(screenWidth, screenHeight, screenScale int, title string) Window
|
|
}
|
|
|
|
type WindowEvents interface {
|
|
ScreenSizeUpdated() <-chan ScreenSizeUpdatedEvent
|
|
InputStateUpdated() <-chan InputStateUpdatedEvent
|
|
WindowClosed() <-chan WindowClosedEvent
|
|
}
|
|
|
|
type Window interface {
|
|
Draw(func(graphics.Canvas))
|
|
WindowEvents
|
|
}
|