Game Development Community

Vertical Slider GUI

by Chris -Clu- Miller · in Technical Issues · 09/11/2008 (10:47 am) · 3 replies

Howdy all!

I've been trying to create a slider bar that uses a vertical orientation rather than a horizontal one with no success. I've done a lot of searching through the Forums and TDN but I have not been able to find any information regarding the changing of orientation for the guiSlider control.

Has anyone ever seen a vertical slider used in Torque, and if so could you drop me a link or reference to where you've seen it. It seems odd to me that there wouldn't be a vertical slider in Torque considering how extensive it range of GUI's is so I'm sure its just that I'm looking in the wrong places.

Thanks in advance!!

About the author

Chris is a software engineer for Boeing, working on logistics software. Former CTO of Sojourn Development on their MMO title 'Glympse' and has worked with Torque since 'Tribes'. Runs a one-man media sweat shop called Cluless Creations.


#1
09/11/2008 (12:17 pm)
I am not sure about TGE, but in TGEA all you have to do is size the thing so it is a vertical slider (narrow width,longer length) and it adjusts to become one. Now if you actually mean a progress bar, well that was a different matter entirely, I had to make my own.
#2
09/11/2008 (1:08 pm)
When you say to size the thing, are you referring to the actual extents of the control or are you referring to the bitmap array (Such that the pieces of the slider are more vertical than horizontal)?

**Edit**

Aha! Yes - merely setting the extents of the slider to be more vertical than horizontal does the trick. Thanks a bunch, Ron! I knew it was going to be something easy... :)
#3
09/11/2008 (6:11 pm)
Egads - okay so this wasn't as straightforward as I thought.

It seems that as soon as I decide to use a Bitmap array for my slider, the engine becomes hell-bent on rendering it in a horizontal orientation regardless of the extent specified for the guiSlider control.

It works great if there is no bitmap array specified and simply renders a default slider complete with hash marks.

I thought perhaps the engine might be looking at the pieces of the bitmap to decide which orientation it should render the pieces so I built a new bitmap making sure that the left-center-right bars were oriented vertically and the thumb pieces were oriented horizontally. The result was a horizontally rendered version of my vertically oriented bitmap. Arg!

Now, one thing I did notice was that when the engine came into the guiSliderCtrl::onRender() method, that one of the passed parameters is an offset (Point2I). Closer examination reveals that the X and Y elements of this struct appear to be horizontally oriented (The X value is greater than the Y value) and I'm not sure where this struct is being populated.

I suppose I could go in an manually edit the values of these XY elements to see if it changes how the bitmaps get rendered but I'm hoping there is an easy explaination as to why this is happening.

Any suggestions/help would be greatly appriciated! :)