Game Development Community

Displaying/Rotating image

by Adam Zeid · in Torque Game Engine · 08/26/2001 (6:20 pm) · 1 replies

I am trying to create a HUD that gets rotated based on some action-based code inside the actual engine. I have everything working except for the actual display of the HUD. I have read the HUD example posts by Labrat but they don't deal with this sort of thing. What would be the best way to go about doing this?

Thanks a ton.

#1
08/28/2001 (11:14 am)
Basically, the HUD is a series of classes derived from GuiControl as a base.

The classes themselves have a few virtual functions, the most important one being "onRender", which is where the control is displayed.

Now to display the control, you can use a series of functions in dgl.cc which are basically helper functions written in opengl (although they dont actually go straight to opengl, but instead go into the wrapper and then into gl).

Its simply a matter of tying up the control class to the data and figuring out how to render it.

My advice if you want to learn, is to take a look at the bitmap control class first.. from there, try and modify that to rotate (here's a hint, there is a routine to draw a rotated bitmap somewhere in dgl.cc).

Or alternatively, wait until I post some of the controls Ive done (including rotated bitmap controls) and use that as a start.

Phil.