Game Development Community

Updating 2nd Window HUD information

by Rob Nichols · in Torque Game Builder · 05/27/2013 (1:18 pm) · 2 replies

Hey- By way of introduction, I'm Rob, I've been able to answer most of my questions on the various games by relying on the forum community, so thank you for that. This is my first, probably not last, call for help.

My current issue is with the second window HUD detailed by Michael Perry. I followed the directions here: http://www.garagegames.com/community/blogs/view/21753

It loaded well, calls up perfectly and looks the way I wanted it to. But I'm having trouble making the calls in the right places to update the information on the HUD.

I created Text Objects on the HUD window for the number of player lives, number of player collectables, a countdown timer, and a score. I thought following the 'Whack-a-Mole' tutorial would solve those updates, but it appears that I am not placing the update calls in the relevant locations within my own game.

I tried placing them in the t2dSceneWindow::onUpdatedScene() - located in my player.cs
I tried creating a separate script file and using hudWindow::onLevelLoaded() to call when the hud window is active. I was thinking that it may need to update from within the hudWindow rather than the t2dWindow, but really just don't know.

Any thoughts/ideas?

About the author

Owner of Game Crossing Studios I've been a hobby game maker for a while and decided to jump in with both feet. Feel free to see what I'm up to: www.GameCrossingStudios.com


#1
05/27/2013 (1:37 pm)
Oops, simple mistake. I had not listed a class type for my Text Objects. Once I did, I was able to use the following to update.

function hudClass::onLevelLoaded(%this)
{
//set initial values
//calls to other functions
}

I'm sure I'll be back to post more questions as I go along.

â™ Rob
#2
05/28/2013 (6:20 am)
Glad you found the answer Rob. Good luck with future development.