function init(self)
msg.post(".", "acquire_input_focus")
self.position = go.get_position()
self.target_position = go.get_position()
end
function update(self, dt)
self.position = vmath.lerp(0.2, self.position, self.target_position)
go.set_position(self.position)
end
function on_input(self, action_id, action)
if action_id == hash("click") and action.pressed then
self.target_position.x = action.x
self.target_position.y = action.y
end
end
It loks like the logo is at position 0,0 (where the green and red axis meet). That is the lower left corner in runtime. The background is probably on a Z value outside of the -1 to 1 range.
Ok, check the position of the sprite in the game object too. If the game object is at Z -1 and the sprite at Z -1 then the final position will be Z -2.
Yes, that is expected. X position 0 is at left edge of screen and Y position 0 is at bottom edge of the screen. If you want it centered you need to set the positions to half the screen width and height. If you are using the mobile template, it is preset to screen size 640x1136.
You are probably getting confused by the background sprite. It is just another sprite. It does not define where the screen starts and ends. Check this annotated image: