frameColor can be a list of colors

This commit is contained in:
Darren Ranalli 2002-08-29 23:36:56 +00:00
parent e735658356
commit a57283816f

View File

@ -942,8 +942,16 @@ class DirectGuiWidget(DirectGuiBase, NodePath):
self.updateFrameStyle()
def setFrameColor(self):
color = self['frameColor']
# this might be a single color or a list of colors
colors = self['frameColor']
if type(colors[0]) == types.IntType or \
type(colors[0]) == types.FloatType:
colors = (colors,)
for i in range(self['numStates']):
if i >= len(colors):
color = colors[-1]
else:
color = colors[i]
self.frameStyle[i].setColor(color[0], color[1], color[2], color[3])
self.updateFrameStyle()