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
This commit is contained in:
Drew C 2020-09-01 11:17:01 +02:00 committed by rdb
parent 6c8066bb61
commit 16f489ac5b

View File

@ -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, parent = base.a2dTopLeft, pos = (0.0, -0.1),
scale = (fontScale, fontScale, 0.0), align = TextNode.ALeft, fg=fgColor, bg=bgColor, scale = (fontScale, fontScale, 0.0),
mayChange = 1, font = font) 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)