Different alignment modes for UI elements
As you already noticed, we have defined the alignment within the XML file. There are different alignment modes that can be used:
dynamic
: A dynamic mode has dynamic horizontal and vertical alignment, without losing aspect ratiofixed
: A fixed position on the screenfullscreen
: Always fullscreen; you have to reposition your movieclips by yourself
Each alignment mode has some additional settings that can be used.
Dynamic alignment
In the dynamic
mode, you need to define a horizontal and vertical alignment and a scale mode:
<Constraints> <Align mode="dynamic" valign="center" halign="center" scale="1" max="0" /> </Constraints>
halign
: Can beleft
,center
, orright
.valign
: Can betop
,center
, orbottom
.scale
: Can be0
or1
. If scaling is enabled, the asset is scaled to fit into the screen. The asset is always 100 percent visible. If disabled, it will always stay in its original resolution (if the resolution is smaller than the asset...