Ok, now this is weird. I saved a font as .png and used in my game, it worked perfectly and everything is just fine. So, now I made a new font, and used it in another project. But even after loading the font, the variable remains as null... I copied the font I used in the other project to the new one... Still null. I changed the graphics driver to use DX7 like in the other project, still null. Everything is just the same, why won't the font load in my second project?
GUI class in my first project:
Type TGUI
Global Neuropol:TImageFont
Global NeuroBig:TImageFont
Global Pixel:TImageFont
Global PixelBig:TImageFont
Function Init()
Neuropol = LoadImageFont("fonts\neuropol.ttf", 12)
NeuroBig = LoadImageFont("fonts\neuropol.ttf", 30)
Pixel = LoadImageFont("fonts\trisk.png",12)
PixelBig = LoadImageFont("fonts\trisk.png",16)
EndFunction
EndTypeThis one loads correctly, no null variables. Now for the second one:
Type TGUI
Global Pixel:TImageFont
Global Crosshair:TImage
Function InitGui()
Pixel = LoadImageFont("fonts\trisk.png",12)
If Pixel = Null Then Print "didnt load again..."
Crosshair = LoadImage("gfx/p_crosshair.png")
End Function
End TypeWhy? I even execute the functions in the same order in both projects, first I create the game window, set mask color and blend mode, then I execute the init function. The path is correct, and it will load as a normal image.
So... If the font worked with my first project, why won't the same font work now in this second one? Is there anything I can do to find out why the font isn't loading and remains as null?