From 5e9443bcffc78f1df4b8a8fd65cb0dd9fc0c1bb8 Mon Sep 17 00:00:00 2001 From: Noah Petherbridge Date: Tue, 25 Jun 2019 14:57:11 -0700 Subject: [PATCH] Add MenuScene with New Level UI * Debug mode: no longer enables the DebugOverlay (F3) by default, but does now insert the current FPS counter into the window title bar. * ui.Frame: set a default "mostly transparent" BG color so the frame background doesn't render as white. * Add the MenuScene which will house the game's main menus. * The "New Level" menu is first to be added. * UI lets you pick Page Type and Wallpaper using radio buttons. * Page Type: Unbounded, Bounded (default), No Negative Space, Bordered * Fix bugs in uix.Canvas to fully support all these page types. --- interface.go | 1 + sdl/sdl.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/interface.go b/interface.go index 092ff08..2c265a5 100644 --- a/interface.go +++ b/interface.go @@ -22,6 +22,7 @@ type Engine interface { // Clear the full canvas and set this color. Clear(Color) + SetTitle(string) DrawPoint(Color, Point) DrawLine(Color, Point, Point) DrawRect(Color, Rect) diff --git a/sdl/sdl.go b/sdl/sdl.go index 9bdd1e7..a3a176a 100644 --- a/sdl/sdl.go +++ b/sdl/sdl.go @@ -84,6 +84,12 @@ func (r *Renderer) Setup() error { return nil } +// SetTitle sets the SDL window title. +func (r *Renderer) SetTitle(title string) { + r.title = title + r.window.SetTitle(title) +} + // GetTicks gets SDL's current tick count. func (r *Renderer) GetTicks() uint32 { return sdl.GetTicks()