dialog skeleton

This commit is contained in:
2023-07-04 19:36:40 +02:00
parent 7874fc022f
commit 1451bd90c0
8 changed files with 162 additions and 51 deletions

View File

@@ -18,18 +18,28 @@ func (e *Engine) Layout(outsideWidth, outsideHeight int) (int, int) {
return e.Settings.Screen.Width, e.Settings.Screen.Height
}
func (e *Engine) ScreenTypeIs(name string) bool {
return e.KContext.Screen.Type == name
}
func (e *Engine) Update(screen *ebiten.Image) error {
e.Controller.Watch()
if e.KContext.Screen.Type == "menu" {
if e.ScreenTypeIs("menu") {
e.MenuUpdate()
}
if e.ScreenTypeIs("dialog") {
e.DialogUpdate()
}
return nil
}
func (e *Engine) Draw(screen *ebiten.Image) {
if e.KContext.Screen.Type == "menu" {
if e.ScreenTypeIs("menu") {
e.MenuDraw(screen)
}
if e.ScreenTypeIs("dialog") {
e.DialogDraw(screen)
}
if e.Controller.Action3Pressed() {
os.Exit(1)
}