mirror of
https://github.com/britzl/monarch.git
synced 2025-09-27 18:12:22 +02:00
Moved advanced example to subfolder. Added basic example.
This commit is contained in:
31
example/advanced/about.gui_script
Normal file
31
example/advanced/about.gui_script
Normal 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
|
Reference in New Issue
Block a user