That's too bad. (The main project that I'm working on right now needs proportional scaling to look right.)
I figured out a work-around that basically makes the display look the way that it should in both portrait and landscape orientation (but it involves some forced orientation changes at the start).
Here's the example from above with some work-around code added:
Code: Select all
@REQUIRE "RapaGUI"
@REQUIRE "polybios"
@DISPLAY {Title="Catechism", Color=#WHITE, Layers=True, Width=600, Height=1920, ScaleMode=#SCALEMODE_LAYER, SmoothScale=True, Hidden=True, SingleMenu=True}
DesiredWidth=600
DesiredHeight=1920
CreateBrush(1, 600, 1920, #BLUE)
SetLineWidth(50)
SelectBrush(1)
Box(0, 0, 600, 1920, #RED)
Box(#CENTER, #CENTER, 400, 400, #RED)
EndSelect
DisplayBrush(1, 0, 0)
AppGUI$=[[<application id="app">
<window id="Main" notify="orientation">
<vgroup frame="true">
<hollywood FixWidth="false" FixHeight="false" display="1"/>
</vgroup>
</window>
</application>]]
moai.CreateApp(AppGUI$)
moai.set("Main", "Orientation", "Landscape")
moai.Set("Main", "open", True)
Wait(50)
LandscapeScreenHeight=GetAttribute(#DISPLAY, 1, #ATTRSCALEHEIGHT)
moai.set("Main", "Orientation", "Portrait")
Wait(50)
PortraitScreenHeight=GetAttribute(#DISPLAY, 1, #ATTRSCALEHEIGHT)
SetDisplayAttributes({ScaleWidth=100*(PortraitScreenHeight/DesiredHeight) .. "%", ScaleHeight=100*(PortraitScreenHeight/DesiredHeight) .. "%"})
moai.set("Main", "Orientation", "Device")
Function p_RapaGUIEvents(msg)
Switch msg.attribute
Case "Orientation":
If moai.get("Main", "Orientation")="Portrait"
SetDisplayAttributes({ScaleWidth=100*(PortraitScreenHeight/1844) .. "%", ScaleHeight=100*(PortraitScreenHeight/DesiredHeight) .. "%"})
ElseIf moai.get("Main", "Orientation")="Landscape"
SetDisplayAttributes({ScaleWidth=100*(LandscapeScreenHeight/DesiredHeight) .. "%", ScaleHeight=100*(LandscapeScreenHeight/DesiredHeight) .. "%"})
EndIf
EndSwitch
EndFunction
InstallEventHandler({RapaGUI=p_RapaGUIEvents})
Repeat
WaitEvent
Forever
(If the display is not going to be rotated, then the work-around code can be simplified.)
Are there any other work-around solutions that you can suggest?