Browse Source

showbase: Parent the OSD to a2dTopLeft

The Y position is set to -0.1 as the original value was 0.9, so it was intended to be about 1 unit down from the top.

Closes #977
Drew C 5 years ago
parent
commit
16f489ac5b
1 changed files with 3 additions and 3 deletions
  1. 3 3
      direct/src/showbase/OnScreenDebug.py

+ 3 - 3
direct/src/showbase/OnScreenDebug.py

@@ -38,9 +38,9 @@ class OnScreenDebug:
             print("failed to load OnScreenDebug font %s" % fontPath)
             print("failed to load OnScreenDebug font %s" % fontPath)
             font = TextNode.getDefaultFont()
             font = TextNode.getDefaultFont()
         self.onScreenText = OnscreenText.OnscreenText(
         self.onScreenText = OnscreenText.OnscreenText(
-                pos = (-1.0, 0.9), fg=fgColor, bg=bgColor,
-                scale = (fontScale, fontScale, 0.0), align = TextNode.ALeft,
-                mayChange = 1, font = font)
+                parent = base.a2dTopLeft, pos = (0.0, -0.1),
+                fg=fgColor, bg=bgColor, scale = (fontScale, fontScale, 0.0),
+                align = TextNode.ALeft, mayChange = 1, font = font)
         # Make sure readout is never lit or drawn in wireframe
         # Make sure readout is never lit or drawn in wireframe
         DirectUtil.useDirectRenderStyle(self.onScreenText)
         DirectUtil.useDirectRenderStyle(self.onScreenText)