Mouse Screen Y Coordinates Different: HTML5 & Android?(SOLVED)

Hi,

Bottom code works as expected on desktop & HTML5 builds.
Bottom code does not work as expected on Android build?

if action_id == hash("ClickGUI") and mY < 575 then
	PlayerDirection = -1
else
	PlayerDirections = 1
end

Screen vertical size is 640.
“mY” is a global variable with current mouse screen Y.

Seems like screen vertical coordinates are reversed on Android?
Can someone confirm this?
Thanks!

Jesse

No, the coordinates are not reversed. Bottom left is always 0,0 and top right is always window width, height.

Ok, thanks…
Must be something in my code.
I’ll hit it with a hammer.

Jesse

Wouldn’t it be easier to create two transparent(invisible) buttons and gui.pick_node, also taking into account the adjust_mode in your GUI.

@britzl is it possible to change the adjust_mode of all nodes in a single line of code, rather than changing them one by one with:

gui.set_adjust_mode(each_node, mode)

No, that’s the function to use. You could create your own utility function and pass in a list of nodes or something.

1 Like
if action_id == hash("ClickGUI") and mY * (640/WindowHeightTrue) < 575 then
	PlayerDirection = -1
else
	PlayerDirections = 1
end