mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-28 15:53:55 -04:00
dgui: Fix ability to create OnscreenGeom/Image/Text without ShowBase
This commit is contained in:
parent
fa8c8e71b5
commit
8883bf9bdd
@ -47,8 +47,9 @@ class OnscreenGeom(DirectObject, NodePath):
|
||||
"""
|
||||
# We ARE a node path. Initially, we're an empty node path.
|
||||
NodePath.__init__(self)
|
||||
if parent == None:
|
||||
parent = aspect2d
|
||||
if parent is None:
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
parent = ShowBaseGlobal.aspect2d
|
||||
|
||||
self.setGeom(geom, parent = parent, sort = sort, color = color)
|
||||
|
||||
|
@ -54,8 +54,9 @@ class OnscreenImage(DirectObject, NodePath):
|
||||
# We ARE a node path. Initially, we're an empty node path.
|
||||
NodePath.__init__(self)
|
||||
|
||||
if parent == None:
|
||||
parent = aspect2d
|
||||
if parent is None:
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
parent = ShowBaseGlobal.aspect2d
|
||||
self.setImage(image, parent = parent, sort = sort)
|
||||
|
||||
# Adjust pose
|
||||
|
@ -104,8 +104,9 @@ class OnscreenText(NodePath):
|
||||
direction: this can be set to 'ltr' or 'rtl' to override the
|
||||
direction of the text.
|
||||
"""
|
||||
if parent == None:
|
||||
parent = aspect2d
|
||||
if parent is None:
|
||||
from direct.showbase import ShowBaseGlobal
|
||||
parent = ShowBaseGlobal.aspect2d
|
||||
|
||||
# make a text node
|
||||
textNode = TextNode('')
|
||||
|
Loading…
x
Reference in New Issue
Block a user