|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Sat Mar 14, 2009 8:05 pm
The XML scripting |
This is the xml definition of a gauge:
Code: |
<button name="c_gauge" type="Gauge" autosize="false" width="200" height="20" inset="true" toolstyle="true" transparent="false" color="#464370" textcolor="white" gaugelowcol="maroon" gaugebackcol="white" priority="2" id="16"> |
It has more features then the ZScript version. Is there a way to alias a gauge creation like this in a script? I would like to use text color. |
|
|
|
Rahab Wizard
Joined: 22 Mar 2007 Posts: 2320
|
Posted: Mon Mar 16, 2009 4:36 pm |
Many of those button attributes cannot be adjusted in a script.
What exactly do you want to do? Change the text color of the guage within a script? Use %btncol(). |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Mon Mar 16, 2009 5:25 pm |
%btncol will adjust text color. You can also access many of these properties via the Lua scripting interface:
Code: |
btn = zs.getbutton("c_gauge")
btn.textcol = 0x0000ff |
would change the text color to red (colors are BGR instead of normal RGB). You can see all of the button properties available here: buttons
I noticed in v3.05 that there seems to be a bug that causes a button to disappear when doing the above script, and I've added that to the bug list. Resizing the window seems to bring back the buttons, so I'm not exactly sure what's happening and if there is a way within the script to also cause the button to reappear. |
|
|
|
Leitia Adept
Joined: 04 May 2007 Posts: 292 Location: Boston
|
Posted: Mon Mar 16, 2009 6:25 pm |
TY much for the solution, also that you have enabled its access Zugg.
The default color of my gauge when changed by a script to a non standard color also overwrites the text color of the gauge making the text invisible.
I will have to get over my fear of Lua to play with this cool new UI at it's fullest, but even at a glance can appreciate the change. |
|
|
|
Arde Enchanter
Joined: 09 Sep 2007 Posts: 605
|
Posted: Tue Apr 21, 2009 8:58 pm |
Zugg wrote: |
Code: |
btn = zs.getbutton("c_gauge")
btn.textcol = 0x0000ff |
I noticed in v3.05 that there seems to be a bug that causes a button to disappear when doing the above script, and I've added that to the bug list. Resizing the window seems to bring back the buttons, so I'm not exactly sure what's happening and if there is a way within the script to also cause the button to reappear. |
Still an issue in 3.06. |
|
|
|
Zugg MASTER
Joined: 25 Sep 2000 Posts: 23379 Location: Colorado, USA
|
Posted: Wed Apr 22, 2009 4:32 pm |
Yep, it is still on the bug list.
|
|
|
|
|
|