3
0
mirror of https://github.com/britzl/monarch.git synced 2025-09-27 18:12:22 +02:00

A couple of bug fixes. Added reload option.

This commit is contained in:
Björn Ritzl
2017-11-22 13:28:27 +01:00
parent d02cd03d2c
commit 4c65581456
7 changed files with 1073 additions and 12 deletions

31
example/about.gui_script Normal file
View File

@@ -0,0 +1,31 @@
local monarch = require "monarch.monarch"
local transitions = require "monarch.transitions.gui"
function init(self)
msg.post(".", "acquire_input_focus")
gui.set_render_order(15)
self.transition = transitions.create(gui.get_node("root"))
.show_in(transitions.slide_in_top, gui.EASING_OUTQUAD, 0.6, 0)
.show_out(transitions.slide_out_top, gui.EASING_INQUAD, 0.6, 0)
.back_in(transitions.slide_in_top, gui.EASING_OUTQUAD, 0.6, 0)
.back_out(transitions.slide_out_top, gui.EASING_INQUAD, 0.6, 0)
end
function on_input(self, action_id, action)
if action_id == hash("touch") and action.released then
if gui.pick_node(gui.get_node("ok_reload_button"), action.x, action.y) then
monarch.show(hash("menu"), { reload = true })
elseif gui.pick_node(gui.get_node("ok_clear_button"), action.x, action.y) then
monarch.show(hash("menu"), { clear = true })
elseif gui.pick_node(gui.get_node("ok_clearreload_button"), action.x, action.y) then
monarch.show(hash("menu"), { clear = true, reload = true })
elseif gui.pick_node(gui.get_node("ok_button"), action.x, action.y) then
monarch.show(hash("menu"))
end
end
end
function on_message(self, message_id, message, sender)
self.transition.handle(message_id, message, sender)
end