|
Post by barliesque on Feb 24, 2005 2:29:49 GMT
After having set up a text layer for displaying debugging information while the program is running, I call the following function within the main program loop. Any items that've been added to the list of debug information gets displayed here. It works just fine, except, that the font is *wrong* ...I can remove the HUDsetFont statement, and it looks just the same. It appears to be using the last font loaded.
Function ShowDebugInfo(PosY% = 0)
Local Debug.DebugInfoList Local DebugDisplay.DebugVars = First DebugVars Local ShowInfo%
ShowInfo = DebugDisplay\ShowInfo If KeyHit(59) Then ShowInfo = True If KeyHit(60) Then ShowInfo = False
HUDsetLayer DebugDisplay\Layer HUDlayerCLS DebugDisplay\Layer HUDsetFont DebugDisplay\Font For Debug.DebugInfoList = Each DebugInfoList If ShowInfo Or Left$(Debug\Info,3) = "FPS" HUDtext Debug\PosX, PosY, Debug\Info, 0,0, 0.25 PosY = PosY + (DebugDisplay\Font\ys * DebugDisplay\Font\blocksize) EndIf Delete Debug Next End Function
|
|
|
Post by barliesque on Feb 24, 2005 11:03:27 GMT
Okay, I see the problem: HUDSetFont only sets the current font, and layers are permanently assigned with a font when they're created.
Hmmm... Might be nice to have a function that allows a layer to change fonts.
|
|
|
Post by Beaker on Feb 25, 2005 2:32:31 GMT
You can't have more than one font on a single layer cos Fontext is optimised around this. Makes everything run as fast as possible.
|
|
|
Post by mjhszxy on Jul 28, 2008 1:24:55 GMT
|
|