Page 1 of 1

OnMouseMove not working with a Hollywood Display in RapaGUI 2.0 (Android)

Posted: Sat Feb 16, 2019 3:15 am
by PEB
If you run the following code on the new Android player, two displays will open; but it will only work on the Hollywood display (not when the RapaGUI display is active):

Code: Select all

@REQUIRE "RapaGUI"
@REQUIRE "polybios"
@DISPLAY {Width = 640, Height = 480, Color = #BLACK, Layers=True}

TextOut(10, 10, "Mouse Position:", {Name="Text"})

Function p_UpdatePos(msg)
	SetLayerStyle("Text", {Text="Mouse Position:\nX="..msg.x.."\nY="..msg.y..""})
EndFunction

AppGUI$=[[<application id="app">
	<window id="Main" closegadget="true">
		<vgroup frame="true">
			<hollywood FixWidth="false" FixHeight="false" display="1"/>
		</vgroup>
	</window>
</application>]]
moai.CreateApp(AppGUI$)

InstallEventHandler({OnMouseMove=p_UpdatePos})

Repeat
	WaitEvent
Forever

Re: OnMouseMove not working with a Hollywood Display in RapaGUI 2.0 (Android)

Posted: Sat Feb 16, 2019 1:25 pm
by airsoftsoftwair
Right, I can reproduce this here. Will be fixed.

Re: OnMouseMove not working with a Hollywood Display in RapaGUI 2.0 (Android)

Posted: Sat May 04, 2019 7:14 pm
by airsoftsoftwair
Ok, so that's a feature, not a bug, the desktop version behaves the same. As soon as a Hollywood display is open, Hollywood will try to get the mouse positions from it instead of from the child. This is why you won't be able to obtain mouse positions from a display embedded inside a GUI if the parent Hollywood display is open as well. So as a rule of thumb, just keep the parent Hollywood display hidden and there won't be any problems.

Re: OnMouseMove not working with a Hollywood Display in RapaGUI 2.0 (Android)

Posted: Tue Jun 11, 2019 11:51 am
by Clyde
Could this be the same problem with include order of RapaGUI described here? -> viewtopic.php?f=10&t=2057

Re: OnMouseMove not working with a Hollywood Display in RapaGUI 2.0 (Android)

Posted: Tue Jun 11, 2019 7:28 pm
by airsoftsoftwair
No, that was a different issue that has been fixed now.