mirror of
https://github.com/panda3d/panda3d.git
synced 2025-09-29 00:06:44 -04:00
gui: Allow OnscreenImage to be used before ShowBase is created
Use TexturePool directly instead of a loader being present in the builtins Fixes #1209
This commit is contained in:
parent
82ebf908fa
commit
24755bc8eb
@ -114,7 +114,9 @@ class OnscreenImage(DirectObject, NodePath):
|
|||||||
tex = image
|
tex = image
|
||||||
else:
|
else:
|
||||||
# It's a Texture file name
|
# It's a Texture file name
|
||||||
tex = loader.loadTexture(image)
|
tex = TexturePool.loadTexture(image)
|
||||||
|
if not tex:
|
||||||
|
raise IOError('Could not load texture: %s' % (image))
|
||||||
cm = CardMaker('OnscreenImage')
|
cm = CardMaker('OnscreenImage')
|
||||||
cm.setFrame(-1, 1, -1, 1)
|
cm.setFrame(-1, 1, -1, 1)
|
||||||
self.assign(parent.attachNewNode(cm.generate(), sort))
|
self.assign(parent.attachNewNode(cm.generate(), sort))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user