|
@@ -5,6 +5,7 @@ __all__ = ['DirectWaitBar']
|
|
|
from pandac.PandaModules import *
|
|
from pandac.PandaModules import *
|
|
|
import DirectGuiGlobals as DGG
|
|
import DirectGuiGlobals as DGG
|
|
|
from DirectFrame import *
|
|
from DirectFrame import *
|
|
|
|
|
+import types
|
|
|
|
|
|
|
|
"""
|
|
"""
|
|
|
import DirectWaitBar
|
|
import DirectWaitBar
|
|
@@ -31,6 +32,7 @@ class DirectWaitBar(DirectFrame):
|
|
|
('value', 0, self.setValue),
|
|
('value', 0, self.setValue),
|
|
|
('barBorderWidth', (0, 0), self.setBarBorderWidth),
|
|
('barBorderWidth', (0, 0), self.setBarBorderWidth),
|
|
|
('barColor', (1, 0, 0, 1), self.setBarColor),
|
|
('barColor', (1, 0, 0, 1), self.setBarColor),
|
|
|
|
|
+ ('barTexture', None, self.setBarTexture),
|
|
|
('barRelief', DGG.FLAT, self.setBarRelief),
|
|
('barRelief', DGG.FLAT, self.setBarRelief),
|
|
|
('sortOrder', NO_FADE_SORT_INDEX, None),
|
|
('sortOrder', NO_FADE_SORT_INDEX, None),
|
|
|
)
|
|
)
|
|
@@ -80,6 +82,17 @@ class DirectWaitBar(DirectFrame):
|
|
|
self.barStyle.setColor(color[0], color[1], color[2], color[3])
|
|
self.barStyle.setColor(color[0], color[1], color[2], color[3])
|
|
|
self.updateBarStyle()
|
|
self.updateBarStyle()
|
|
|
|
|
|
|
|
|
|
+ def setBarTexture(self):
|
|
|
|
|
+ # this must be a single texture (or a string).
|
|
|
|
|
+ texture = self['barTexture']
|
|
|
|
|
+ if isinstance(texture, types.StringTypes):
|
|
|
|
|
+ texture = loader.loadTexture(texture)
|
|
|
|
|
+ if texture:
|
|
|
|
|
+ self.barStyle.setTexture(texture)
|
|
|
|
|
+ else:
|
|
|
|
|
+ self.barStyle.clearTexture()
|
|
|
|
|
+ self.updateBarStyle()
|
|
|
|
|
+
|
|
|
def update(self, value):
|
|
def update(self, value):
|
|
|
self['value'] = value
|
|
self['value'] = value
|
|
|
|
|
|