I am adding multiple gui nodes by code with gui.new_box_node() and I want to drag them on screen. The screen size in config is 640x1136. When the screen is bigger the node remains behind.
if action_id == hash("touch") then
for i = 1, #self.items, 1 do
if gui.pick_node(self.items[i], action.x, action.y) then
if action.pressed then
self.current_item = self.items[i]
self.dragging = true
elseif action.release then
self.current_item = nil
self.dragging = false
end
break
end
end
if self.current_item and self.dragging then
gui.set_position(self.current_item, vmath.vector3(action.x, action.y, 0))
return true
end
end
I am using the default render script with gui_extra_functions (used in another part of the app) and no other modification. I know I have to compensate for the resize, but I am not that clear how. I am getting the window size from the render script.
Thanks.