mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 18:31:55 -04:00
auto float formatting
This commit is contained in:
parent
03e8cbc717
commit
55e83fdc5c
@ -2,6 +2,7 @@
|
||||
|
||||
from PandaModules import *
|
||||
|
||||
import types
|
||||
import OnscreenText
|
||||
import DirectUtil
|
||||
|
||||
@ -38,7 +39,11 @@ class OnScreenDebug:
|
||||
# frame (key roughly equals value):
|
||||
#isNew = "was"
|
||||
isNew = "~"
|
||||
self.onScreenText.appendText("%20s %s %-44s\n"%(k, isNew, v[1]))
|
||||
value = v[1]
|
||||
if type(value) == types.FloatType:
|
||||
value = "% 10.4f"%(value,)
|
||||
# else: other types will be converted to str by the "%s"
|
||||
self.onScreenText.appendText("%20s %s %-44s\n"%(k, isNew, value))
|
||||
self.onScreenText.appendText(self.text)
|
||||
self.frame += 1
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user