mirror of
https://github.com/britzl/monarch.git
synced 2025-09-27 18:12:22 +02:00
Adding monarch.screen_exists(id)
In some projects may need to wait until initial screen has been registered before attempting to show it
This commit is contained in:
@@ -1,6 +1,14 @@
|
||||
local monarch = require "monarch.monarch"
|
||||
|
||||
function init(self)
|
||||
monarch.show(hash("menu"))
|
||||
self.wait = true
|
||||
msg.post("@render:/", "clear_color", { color = vmath.vector4(0.4, 0.6, 0.8,1.0) })
|
||||
end
|
||||
|
||||
function update(self)
|
||||
-- Ensure that the initial screen has had enough time to register
|
||||
if self.wait == true and monarch.screen_exists(hash("menu")) then
|
||||
self.wait = false
|
||||
monarch.show(hash("menu"))
|
||||
end
|
||||
end
|
||||
|
Reference in New Issue
Block a user