Re: Correct way to animate scrolling inside a ScrollActor



On 08/07/2014 03:28 PM, Thomas Schüßler wrote:
Hi,

I'm currently setting easing_mode/easing_duration for a ScrollActor but this applies to all properties for the actor. I don't want the other properties of the actor (position/size) to be animated.

Thanks,
Thomas

I think, I figured it out myself:

python:

class ScrollPointTransition(Clutter.Transition):
    def __init__(self, from_point, to_point):
        Clutter.Transition.__init__(self)
self.interval = Clutter.Interval(value_type=Clutter.Point, final=to_point)
        self.interval.set_initial(from_point)
        self.set_interval(self.interval)
        self.set_progress_mode(Clutter.AnimationMode.EASE_OUT_EXPO)

    def do_compute_value(self, animatable, interval, progress):
        point = interval.compute(progress)
        animatable.scroll_to_point(point)


Thanks,
Thomas



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]