Download Now

    Reference TAnimator

    Declared in Codebot.Animation.pas on line 416

    TAnimator moves float properties toward target values over time using easing functions. Call Step regularly, such as from a TAnimationTimer, to update all animated properties.
      TAnimator = class
      public
        { Animate adds a property to the list of animated items. Easing can be given
          by name or function and duration is in seconds. }
        procedure Animate(var Prop: Float; Target: Float; const Easing: string; Duration: Double = 0.25); overload;
        procedure Animate(var Prop: Float; Target: Float; Easing: TEasing = nil; Duration: Double = 0.25); overload;
        { Animate a property and notify an object implementing IFloatPropertyNotify
          each time the property changes }
        procedure Animate(NotifyObject: TObject; var Prop: Float; Target: Float; const Easing: string; Duration: Double = 0.25); overload;
        procedure Animate(NotifyObject: TObject; var Prop: Float; Target: Float; Easing: TEasing = nil; Duration: Double = 0.25); overload;
        { Stop removes a property animation }
        procedure Stop(var Prop: Float);
        { Step causes all animated properties to be evaluated }
        procedure Step;
        { Animated is True if a property value changed when Step was last invoked }
        property Animated: Boolean read FAnimated;
        { OnStart is invoked if an animated property requires steps }
        property OnStart: TNotifyDelegate read FOnStart;
        { OnStop is invoked when there are no more properties to animate }
        property OnStop: TNotifyDelegate read FOnStop;
      end;

    See also

    Float in Codebot.System.pas
    TNotifyDelegate in Codebot.System.pas