Game Development Community

How does GuiConsoleTextCtrl refresh?

by Danner Jones · in Torque Game Engine · 02/28/2004 (8:44 pm) · 4 replies

I've looked at the code in GuiConsoleTextCtrl and I can't see where it "refreshes" itself constantly. I use "setValue(...)" and pass it a function name, much like metrics. The GuiConsoleTextCtrl refreshes automatically - you can check by putting an echo in the function being called and watch it fill up the logs :)

I've tweaked GuiMLTextCtrl to support an expression so that I can easily show multiple lines of text - consider it an enhancement to metrics that shows each name/value pair on a separate line. It works like a charm but doesn't have the auto-refresh that GuiConsoleTextCtrl has and I can't see what code is doing it in there.

Thanks,
Nerseus

#1
02/28/2004 (9:36 pm)
Have you looked in onRender?
#2
02/28/2004 (9:56 pm)
Yep, here's all I see (pseudo-code -- nothing points to a refresh):

Fill a white rectangle
Draw a border
Set the bounds
Set the drawing color
Draw the text
Call to renderChildControls

Maybe I'm missing something - I thought maybe a call to resize was it, but I don't think it is.
#3
02/28/2004 (10:53 pm)
OnRender is the only thing that's going to get called every tick...

Look at ::onPreRender()
#4
02/29/2004 (7:04 am)
Ah, if onPreRender is also called every tick then that would do it. Thanks Ben!