Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tween

为兼容 cocos creator 的 Tween 而封装的 tween.js

see

https://github.com/cocos-creator/tween.js

Hierarchy

  • Tween

Index

Constructors

constructor

  • newTween(target: Object): Tween

Properties

Private _command

_command: TweenCommand = new TweenCommand()

Private _default

_default: TweenUnion

Private _uionDirty

_uionDirty: boolean = false

Methods

by

  • by(duration: number, props: ITweenProp, opts?: ITweenOption): this
  • 增加一个绝对缓动

    Parameters

    • duration: number

      缓动时间

    • props: ITweenProp

      缓动的属性,绝对值

    • Optional opts: ITweenOption

      缓动的可选项

    Returns this

call

  • call(callback: function): this
  • 注册缓动执行完成后的回调。

    注:一个 to 或 一个 union 仅支持注册一个。

    Parameters

    • callback: function

      回调

        • (object?: any): void
        • Parameters

          • Optional object: any

          Returns void

    Returns this

delay

  • delay(timeInSecond: number): this
  • 延迟多少时间这个缓动,单位是秒。

    Parameters

    • timeInSecond: number

      时间

    Returns this

repeat

  • repeat(times: number): this
  • 重复几次。

    注:目前多次调用为重写次数,不是累加次数。

    注:repeat(1) 代表重复一次,即执行两次。

    注:暂不支持传入 Tween。

    Parameters

    • times: number

      次数

    Returns this

repeatForever

  • repeatForever(): this

start

  • start(): this
  • 开始执行缓动。

    注:调用此方法后,请勿再增加缓动行为。

    Returns this

stop

  • stop(): this

to

  • to(duration: number, props: ITweenProp, opts?: ITweenOption): this
  • 增加一个相对缓动

    Parameters

    • duration: number

      缓动时间

    • props: ITweenProp

      缓动的属性,相对值

    • Optional opts: ITweenOption

      缓动的可选项

    Returns this

union

  • union(): this

Static Private recursiveForBy

  • recursiveForBy(props: object): void

Generated using TypeDoc