Game Development Community

Multiple Language GUI

by Lexi Pimenidis · in Torque Game Engine · 11/25/2002 (2:20 am) · 2 replies

Hi!

I'm trying to create a GUI with support for multiple
languages by assigning the texts by a
function GetText(%textid) which utilizes a global variable $pref::language, "text = GetText(12);"

Unfortunately it seems like all controls get their text once and it then remains stationary, is there the possibility to write a simple loop which replaces the text for all controls?

Thanks!

About the author

Recent Threads

  • Hosting multiple games

  • #1
    11/25/2002 (6:27 am)
    Try to set the Text of the control in the "::onWake" function of the GUI. Here's what I just tried (and it works ;)). I have a GUI called MyGUI with a button

    new GuiButtonCtrl(StartButton) {
    [blablabla]
    text = "Start Game!";
    };

    Then in the same .GUI file I have a function

    function MyGUI::onWake()
    {
    StartButton.text = "Test";
    }

    Hope that helps ! ;)
    #2
    11/25/2002 (6:33 am)
    Cool, that was exactly what I needed :)