Game Development Community

Can I dynamically edit gui profiles?

by John Klimek · in Torque Game Builder · 10/04/2006 (12:37 pm) · 1 replies

I just made a "GuiFont" gui object (in C++) and it works great. What it does is list all available fonts installed on the machine inside of a list box (eg. GuiFont descends from GuiInputBox).

Now my idea was to create a gui with a GuiText object, my GuiFont object, and an "Apply" button. Whenever the font in GuiFont was changed, the GuiText object's profile would have it's fontType changed but this doesn't appear to be working.

Can you dynamically edit gui profiles once they have been loaded? (eg. change GuiTextProfile's fontType and have it be reflected on-screen)

It appears to let me change the variable inside of the console (eg. GuiTextProfile.fontType) but the change doesn't appear to do anything.

Thanks for any help...

(btw, the whole purpose of this mini-project of mine is create a tool for viewing how different fonts will look in TGB without having the edit profiles.cs [or whatever] and then reload TGB to see the changes)

#1
10/04/2006 (1:53 pm)
You can edit gui profiles and have the changes take effect. I actually do that to continuously change the color of a button. However, you must force the text control to reprocess all of the text. Not quite sure how to do that off hand, you should dig through GuiTextCtrl.cc, and you may have to write a quick console method to force it to reload.