mirror of
https://github.com/panda3d/panda3d.git
synced 2025-10-03 10:22:45 -04:00
frameColor can be a list of colors
This commit is contained in:
parent
e735658356
commit
a57283816f
@ -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()
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user