You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
"my game fails in the init of a screen’s scripts, because “monarch.top()” returns nil."
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("#", "start")
end
function on_message(self, message_id, message, sender)
if message_id == hash("start") then
monarch.show(hash("musicSpace"),{no_stack=true})
--monarch.show(hash("gameSpace"),{no_stack=true})
--monarch.show(hash("Mousechief"))
--monarch.show(hash("Introduction"))
--monarch.show(hash("BattleOne"))
monarch.show(hash("combat"), {}, {"battle01"})
--monarch.show(hash("testScreen"), {}, {"testScript"})
end
end
The text was updated successfully, but these errors were encountered:
Unable to reproduce. I modified the basic example. In basic.script I did:
local monarch = require "monarch.monarch"
function init(self)
msg.post(".", "acquire_input_focus")
msg.post("#", "show_screens")
end
function on_message(self, message_id, message, sender)
if message_id == hash("show_screens") then
monarch.show("screen1",{no_stack=true})
monarch.show("screen2")
end
end
And in screen2.gui__script I have this:
local monarch = require "monarch.monarch"
function init(self)
msg.post(".", "acquire_input_focus")
print("TOP", monarch.top())
end
With the log showing DEBUG:SCRIPT: TOP hash: [screen2]
From forum post: https://forum.defold.com/t/monarch-simple-screen-manager/14138/30?u=britzl
"my game fails in the init of a screen’s scripts, because “monarch.top()” returns nil."
The text was updated successfully, but these errors were encountered: