Page 1 of 1

Button Detection using RapaGUI with FitScale and KeepProportions

Posted: Fri Sep 09, 2022 12:07 am
by PEB
There seems to be a problem with buttons being detected in the correct location when using RapaGUI with Fitscale and KeepProportions set to "True." The vertical placement seems to be correct, but the horizontal placement is wrong. (The same problem shows up whether #LAYERBUTTON or #SIMPLEBUTTON is used.)

Code: Select all

@REQUIRE "RapaGUI"
@DISPLAY {Color=#WHITE, Layers=True, Width=800, Height=600, ScaleMode=#SCALEMODE_LAYER, FitScale=True, KeepProportions=True, Hidden=False}

moai.CreateApp([[<application id="app">
	<window id="Main" Title="Test" closegadget="true" open="true">
		<vgroup>
			<hollywood display="1"/>
		</vgroup>
	</window>
</application>]])

Function p_TestButtonFunc(msg)
	Switch msg.action
	Case "OnMouseOver":
		DebugPrint("Over")
	Case "OnMouseOut":
		DebugPrint("Out")
	EndSwitch
EndFunction
TestButtonTable={OnMouseOver=p_TestButtonFunc, OnMouseOut=p_TestButtonFunc}
SetFillStyle(#FILLCOLOR)
Box(20, #CENTER, 200, 200, #RED, {Name="Test"})
MakeButton(1, #LAYERBUTTON, "Test", TestButtonTable)
;MakeButton(1, #SIMPLEBUTTON, 20, #CENTER, 200, 200, TestButtonTable)

Repeat
	WaitEvent
Forever

Re: Button Detection using RapaGUI with FitScale and KeepProportions

Posted: Fri Sep 09, 2022 11:22 pm
by airsoftsoftwair
True, I can reproduce this. Will be fixed.