mirror of
https://github.com/britzl/monarch.git
synced 2025-09-27 18:12:22 +02:00
Added focus and post listener setup functions
This commit is contained in:
@@ -2,9 +2,9 @@ local monarch = require "monarch.monarch"
|
||||
local transitions = require "monarch.transitions.gui"
|
||||
|
||||
function init(self)
|
||||
print("window2", msg.url())
|
||||
msg.post(".", "acquire_input_focus")
|
||||
|
||||
local DURATION = 1
|
||||
local DURATION = 0.3
|
||||
local transition = transitions.create(gui.get_node("bg"))
|
||||
.show_in(transitions.slide_in_right, gui.EASING_LINEAR, DURATION, 0)
|
||||
.show_out(transitions.slide_out_left, gui.EASING_LINEAR, DURATION, 0)
|
||||
@@ -12,8 +12,6 @@ function init(self)
|
||||
.back_out(transitions.slide_out_right, gui.EASING_LINEAR, DURATION, 0)
|
||||
|
||||
monarch.on_transition("window2", transition)
|
||||
|
||||
msg.post(".", "acquire_input_focus")
|
||||
end
|
||||
|
||||
function on_input(self, action_id, action)
|
||||
@@ -25,5 +23,6 @@ function on_input(self, action_id, action)
|
||||
end
|
||||
|
||||
function on_message(self, message_id, message, sender)
|
||||
print("window2", message_id, message, sender)
|
||||
monarch.on_message(message_id, message, sender)
|
||||
end
|
Reference in New Issue
Block a user