mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-04 10:54:24 -04:00
made onScreenDebug config-able
This commit is contained in:
parent
6bc080f519
commit
fc22e864eb
@ -9,6 +9,7 @@ class OnScreenDebug:
|
||||
def __init__(self):
|
||||
fontPath = config.GetString("on-screen-debug-font", "cmtt12")
|
||||
fontScale = config.GetFloat("on-screen-debug-font-scale", 0.05)
|
||||
self.enabled = config.GetBool("on-screen-debug-enabled", 0)
|
||||
font = loader.loadFont(fontPath)
|
||||
if not font.isValid():
|
||||
print "failed to load OnScreenDebug font", fontPath
|
||||
@ -24,6 +25,8 @@ class OnScreenDebug:
|
||||
self.data = {}
|
||||
|
||||
def render(self):
|
||||
if not self.enabled:
|
||||
return
|
||||
self.onScreenText.clearText()
|
||||
for k, v in self.data.items():
|
||||
if v[0] == self.frame:
|
||||
|
Loading…
x
Reference in New Issue
Block a user