Best method for HUD

Hi,

I’m creating a HUD for a car game and I’m not sure what the best method to create it. So far I have a couple of GUI boxes for the speed and the number of checkpoints passed. I now need to put a background behind the GUI objects, I’ve used the GUI.DrawTexture function but it’s drawing the texture on top of the GUI objects, is it possible to make it draw underneath the GUI objects?

Or am I going about this in the wrong way?

Thanks,

eb_dev

The order that functions are called matter as well. Take these two code snippets:

function OnGUI()
{
  GUI.DrawTexture( myRect, bgImage );
  GUI.Label( myRect, "This is a label!" );
}
function OnGUI()
{
  GUI.Label( myRect, "This is a label!" );
  GUI.DrawTexture( myRect, bgImage );
}

The last one called is the one drawn on top of what’s been called.

Hey Asvarduil thanks for your reply, I’ll bear that in mind in future. I’ve figured out GUITextures now so thankfully got it working.