UIElement:Gauge woes

tinyromeo

Active Member
I am going to post this in Lax's forums as well cause I know it is an innerspace thingy, but if anyone here has a moment...

I am trying to get a gauge to.. well fill...
so far I have successfully textured a slider, it isn't what I want, but I figured I the syntax would be similar, thusly it is not...

So far I am doing...

This for my UI, the slider I textured is first then my unworking gauge
Code:
<slider Name='eSlider'>
	<X>10</X>
	<Y>300</Y>
	<Border>1</Border>
	<Width>20</Width>
	<Height>50</Height>
	<Range>100</Range>
	<Vertical></Vertical>
	<Texture Filename='Green.png'></Texture>
	<AutoTooltip>Zoom level</AutoTooltip>
</slider>

<gauge Name='eGauge'>
	<X>50</X>
	<Y>300</Y>
	<Border>1</Border>
	<Width>20</Width>
	<Height>50</Height>
	<Range>100</Range>
	<Value>0</Value>
	<Vertical></Vertical>
	<Texture filename='Red.png'></Texture>
	<Filler>
		<Texture filename="Green.png"></Texture>
	</Filler>
	
	<AutoTooltip>Zoom level</AutoTooltip>
</gauge>
And I am doing this in my code (which I know the slider is working, cause it moves... and also the text updates correctly as well so hmmm...)

Code:
while 1
{
wait 2
i:Inc
UIElement[eSlider@eMainTab@eTabControl@eveboxerui]:SetValue[${i}]
UIElement[eBotState@eMainTab@eTabControl@eveboxerui]:SetText[${i}]
UIElement[eGauge@eMainTab@eTabControl@eveboxerui]:SetValue[${i}]
}
The slider works dandy, the text counts along, but the gauge doesn't fill... any thoughts?
 

tinyromeo

Active Member
Turns out it was the X value... needed to be a % instead of a coordinate. Also I am not sure how to work the filler attribute, so I ditched it, its filling with the default white bar, and I am just changing the background color which is fine.
Of all the damned things though... The X value??? Really? Should I expect this out of other elements do you think?

Code:
<gauge name='esGauge'>
	<X>1%</X>
	<Y>2</Y>
	<Height>50</Height>
	<Width>20</Width>
	<Range>100</Range>
	<Border>1</Border>
	<Vertical></Vertical>
	<OnRender>
		This.Texture:SetColorMask[${Script[eboxer].VariableScope.colord.Hex}]
		This:SetValue[${Script[eboxer].VariableScope.i}]
	</OnRender>
	<Texture Filename='White.png'>
	</Texture>
</gauge>
and just because it makes me smile a little, here is the color code in script, it makes the color go from red to green as i increases from 0 - 100.
colord is a rgb datatype
i is int datatype
Code:
while 1
{
	waitframe
	waitframe
	i:Inc
	if ${i} < 0
		i:Set[100]
	if ${i} > 100
		i:Set[0]
	colord:Set["${Math.Hex[${Math.Calc[255 - (${i} * 2.55)]}]}${Math.Hex[${Math.Calc[${i} * 2.55]}]}00"]
	if ${i} < 7
		colord:Set["FF0000"]
}
 
Top Bottom