i'am trying to get a prgress bar to go up and down when i use the throttle of a joystick
i,ve managed to get the throttle name to appear ok but cant seem to work out how to make the progress bar work
can someone see where i messed up please
xml layout
Code: Select all
<Window Type="skin/ProgressBar" Name="throttle" >
<Property Name="StepSize" Value="0.01" />
<Property Name="UnifiedMaxSize" Value="{{1,0},{1,0}}" />
<Property Name="CurrentProgress" Value="0" />
<Property Name="UnifiedAreaRect" Value="{{0.357247,0},{0.191645,0},{0.607247,0},{0.274619,0}}" />
</Window>
code
Code: Select all
float Throttle;
ProgressBar* line = static_cast<ProgressBar*>(winMgr.getWindow( "throttle"))->setProgress(Throttle);
if(Throttle <= 1.0f)
{
line->setPosition(CEGUI::Point(0, 1 -Throttle));
}
else if(nuiThrottleScale > 1.0f)
{
line->setPosition(CEGUI::Point(0, 0));
}
else
{
line->setPosition(CEGUI::Point(0, 1));
}
TIA