Drawing text on a 3D screen?
Posted: Thu Apr 14, 2016 3:43 pm
Hi,
I was wondering what the best practises are when drawing simple text on a 3D screen?
Up until now I was simply using DrawText() to print out some debugging information.
Something like this:
This works as I want, until the framerate starts to decrease below VBL. Then the text simply disappears.
So I´m assuming that DrawText() isn´t reliable to use for this? Or is there a workaround?
I looked at CreateText3D() but since that requires a node or entity its just not what I want. I would like to just rely on 2D coordinates for this, if possible.
I was wondering what the best practises are when drawing simple text on a 3D screen?
Up until now I was simply using DrawText() to print out some debugging information.
Something like this:
Code: Select all
Repeat
Repeat
Event = WindowEvent()
Until Event = 0 Or #PB_Event_CloseWindow
If Event = #PB_Event_CloseWindow Or KeyboardPushed(#PB_Key_Escape)
End
EndIf
;-- Do 3D stuff
;-- here..
RenderWorld()
;--2D stuff--
StartDrawing()
DrawText(10,100, "Hello")
DrawText(10.115, "Hello again")
StopDrawing()
;---
FlipBuffers()
ForEver
So I´m assuming that DrawText() isn´t reliable to use for this? Or is there a workaround?
I looked at CreateText3D() but since that requires a node or entity its just not what I want. I would like to just rely on 2D coordinates for this, if possible.