0
Trying to create circles that will work on all devices using an eval tag. Sometimes it works and sometimes it doesnt. wire below.
<code>
<main>
<panel name="rectangle" width="40%" height="15%" background="#ff0000" align="center" valign="center">
<panel name="circle" alias="CIRCLE" height="100%" width="[var:height]" background="#0000ff" align="center" tofront="yes"
cornerradius="[eval: [var:height] / 2"></panel>
</panel>
</main>
<actions>
<action name="setvars" oninit="yes">
<assign property="var:height" value="[object:CIRCLE.height]"/>
</action>
</actions>
</code>
<main>
<panel name="rectangle" width="40%" height="15%" background="#ff0000" align="center" valign="center">
<panel name="circle" alias="CIRCLE" height="100%" width="[var:height]" background="#0000ff" align="center" tofront="yes"
cornerradius="[eval: [var:height] / 2"></panel>
</panel>
</main>
<actions>
<action name="setvars" oninit="yes">
<assign property="var:height" value="[object:CIRCLE.height]"/>
</action>
</actions>
</code>
0
icahill (Administrator) 11 ár síðan
The main issue here is timing. The way you have it written the variable is not created fast enough since your panels are also created oninit. To combat this, you can create the circle in your action using a class like this:
Customer support service by UserEcho