Browse Source

*** empty log message ***

Joe Shochet 24 years ago
parent
commit
f057a225d5
2 changed files with 33 additions and 0 deletions
  1. 31 0
      direct/src/interval/LerpInterval.py
  2. 2 0
      direct/src/showbase/ShowBase.py

+ 31 - 0
direct/src/interval/LerpInterval.py

@@ -386,3 +386,34 @@ class LerpColorScaleInterval(LerpInterval):
         # Initialize superclass
         LerpInterval.__init__(self, name, duration, functorFunc, blendType)
 
+
+
+class LerpColorInterval(LerpInterval):
+    # Name counter
+    lerpColorNum = 1
+    # Class methods
+    def __init__(self, node, duration, startColor, endColor,
+                 other=None, blendType='noBlend', name=None):
+
+        def functorFunc(node=node, startColor=startColor,
+                        endColor=endColor, other=other):
+            assert(not node.isEmpty())
+            if callable(endColor):
+                # This may be a thunk that returns a point.
+                endColor = endColor()
+            if callable(startColor):
+                # This may be a thunk that returns a point.
+                startColor = startColor()
+            if (other != None):
+                functor = ColorLerpFunctor(node, startColor, endColor, other)
+            else:
+                functor = ColorLerpFunctor(node, startColor, endColor)
+            return functor
+
+        # Generate unique name if necessary
+        if (name == None):
+            name = 'LerpColorInterval-%d' % LerpColorInterval.lerpColorNum
+            LerpColorInterval.lerpColorNum += 1
+        # Initialize superclass
+        LerpInterval.__init__(self, name, duration, functorFunc, blendType)
+

+ 2 - 0
direct/src/showbase/ShowBase.py

@@ -306,6 +306,8 @@ class ShowBase:
         using the indicated window.  This should only be called once
         per application.
         """
+
+        print 'setup mouse'
         
         # We create both a MouseAndKeyboard object and a MouseWatcher object
         # for the window.  The MouseAndKeyboard generates mouse events and