Game Development Community

Adding new fonts to TGE/TSE

by University of Central FL (#0003) · in Torque Game Engine · 07/23/2006 (7:11 pm) · 0 replies

I've searched for this on the forums and on TDN, and every post says pretty much the same answer, but I've tried it and my engine crashes.

First, I added the following profile to customProfiles.cs:
new GuiControlProfile (GuiMenuButtonProfile)
{
    opaque = true;
    fontColor = "255 255 255";
    fontColorHL = "100 100 100";
    fillColor = "232 232 232 0";
    fixedExtent = true;
    justify = "center";
    canKeyFocus = false;
    border = false;

    // font
    fontType = "Comic Sans MS";
    fontSize = 25;
    fontCharset = CHINESEBIG5;
};

( I read that for fontType you had to use the full font name instead of the font file name. I tried both ways though, and neither way worked. )

Then, with the game started, I pressed f10 to enter the gui editor.

I created a new GuiControl object, and tried to change the datablock to GuiMenuButtonProfile. When I did this, the engine crashed. Running in debug mode, I got the following error message:

Texture Name is NULL.

I'm just trying to add a timer to our game with a custom font. Any ideas why this would crash the engine?