> Can you mail the full source or a test case ?

Sure, here you go: 

***********************************************************************************

#!/usr/bin/python

import sys
import clutter

class BehaviourRoll (clutter.Behaviour):
                __gtype_name__ = 'BehaviourRoll'
                def __init__ (self, alpha=None):
                                clutter.Behaviour.__init__(self)
                                self.set_alpha(alpha)
                                self.angle_start = 0.0
                                self.angle_end = 359.0

                def do_alpha_notify (self, alpha_value):
                                angle = alpha_value \
                                          * (self.angle_end - self.angle_start) 
\
                                          / clutter.MAX_ALPHA

                                for actor in self.get_actors():
                                        actor.set_opacity (actor.get_opacity() 
- 1)
                                        print actor.get_opacity()

class text_scroll: 
        
        def scroll_down(self, stage, event, menu):

                timeline = clutter.Timeline(40, 50)
                alpha = clutter.Alpha(timeline, clutter.ramp_inc_func)
        
                o_behaviour = BehaviourRoll(alpha)
        
                timeline = clutter.Timeline(40, 50)
                for label in menu:
                        o_behaviour.apply(label)                        
        
                timeline.start()
                timeline.connect("new-frame", self.printBlaat)
                
                                
        def printBlaat(self, stage, event):
                
                print "W00T"

        def main (self):

                text = clutter.Label()
                text.set_text("Test")
                text.set_font_name("Sans Bold 72")
                text.show()
                   
                text2 = clutter.Label()
                text2.set_text("Test2")
                text2.set_font_name("Sans Bold 72")
                text2.show()
        
                self.menu = (text, text2)       

                stage = clutter.stage_get_default()
                stage.set_size(800, 600)
                stage.set_color(clutter.Color(0xcc, 0xcc, 0xcc, 0xff))
                stage.connect('key-press-event', self.scroll_down, self.menu)

                stage.add(text)
                stage.show()
                        
                clutter.main()

if __name__ == '__main__':
        scroll = text_scroll()          
        scroll.main()

***********************************************************************************

-- Gideon
 * http://gideon.nyarna.com

-- 
To unsubscribe send a mail to [EMAIL PROTECTED]

Reply via email to