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

Report any Hollywood bugs here
Post Reply
PEB
Posts: 241
Joined: Sun Feb 21, 2010 1:28 am

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

Post by PEB » Sat Feb 16, 2019 3:15 am

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

User avatar
airsoftsoftwair
Posts: 3065
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Sat Feb 16, 2019 1:25 pm

Right, I can reproduce this here. Will be fixed.

User avatar
airsoftsoftwair
Posts: 3065
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Sat May 04, 2019 7:14 pm

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.

User avatar
Clyde
Posts: 164
Joined: Sun Feb 14, 2010 12:38 pm
Location: Dresden / Germany

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

Post by Clyde » Tue Jun 11, 2019 11:51 am

Could this be the same problem with include order of RapaGUI described here? -> viewtopic.php?f=10&t=2057
Currently using: Hollywood 7.1 with Windows IDE

User avatar
airsoftsoftwair
Posts: 3065
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

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

Post by airsoftsoftwair » Tue Jun 11, 2019 7:28 pm

No, that was a different issue that has been fixed now.

Post Reply