Invert progress bar

Monkey Forums/Monkey Beginners/Invert progress bar

ElRageO(Posted 2015) [#1]
Well I have 2 progress bars in my program I am using as "Health Bars" using igui

The progress bar on the right side of the screen I want to invert so that the power decreases the opposite way of the first one.

The Idea is to have the players health decline opposite of the enemy in a duel like below. Is this possible ?

<---------------------------- ----------------------------->
I have adjusted all of the variables to no avai trying negative numbers to get it ton invert...l. I thought of rotating it 180 but I dont know how to rotate a progress bar :(



Self.progressBar2=New iGuiProgressBarH
		Self.progressBar2.AttachLast(Self.playfield)
		iGuiPrototype(Self.progressBar2, 200, 16)
		Self.progressBar2.Maximum (1000)
		
		Self.progressBar2.Value (250)
		'Self.progressBar.Percentage(50,50)
		Self.progressBar2.X =600
		Self.progressBar2.Y =30
		Self.progressBar2.surfaceRed=150  	
		Self.progressBar2.surfaceGreen=0  
		Self.progressBar2.surfaceBlue=0  



MikeHart(Posted 2015) [#2]
If you can scale it during rendering, give it a -1 value on the x axxis. That might work.


ElRageO(Posted 2015) [#3]
I tried that but could not get it to work. I stumbled into the solution digging deeper into the documentation. Apparently the bar inherits the gui object class parameters. so
 Self.progressBar2.rotation=180 
worked just fine I was able to flip it 180. and it worked just as I wanted.


MikeHart(Posted 2015) [#4]
Which gui class are you talking about?


ElRageO(Posted 2015) [#5]
Im using ignition x and not sure if im even using the terminology correctly. (complete monkey x and object oriented programming noob) Im reading through the documentation it says that igui objects inherit the object class params ?? so thats why I was able to use .rotation .