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):
|
def __init__(self):
|
||||||
fontPath = config.GetString("on-screen-debug-font", "cmtt12")
|
fontPath = config.GetString("on-screen-debug-font", "cmtt12")
|
||||||
fontScale = config.GetFloat("on-screen-debug-font-scale", 0.05)
|
fontScale = config.GetFloat("on-screen-debug-font-scale", 0.05)
|
||||||
|
self.enabled = config.GetBool("on-screen-debug-enabled", 0)
|
||||||
font = loader.loadFont(fontPath)
|
font = loader.loadFont(fontPath)
|
||||||
if not font.isValid():
|
if not font.isValid():
|
||||||
print "failed to load OnScreenDebug font", fontPath
|
print "failed to load OnScreenDebug font", fontPath
|
||||||
@ -24,6 +25,8 @@ class OnScreenDebug:
|
|||||||
self.data = {}
|
self.data = {}
|
||||||
|
|
||||||
def render(self):
|
def render(self):
|
||||||
|
if not self.enabled:
|
||||||
|
return
|
||||||
self.onScreenText.clearText()
|
self.onScreenText.clearText()
|
||||||
for k, v in self.data.items():
|
for k, v in self.data.items():
|
||||||
if v[0] == self.frame:
|
if v[0] == self.frame:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user