Options
All
  • Public
  • Public/Protected
  • All
Menu

Class Tween<T>

Tween provide a simple and flexible way to action, It's transplanted from cocos creator。

param
example

tween(this.node) .to(1, {scale: new Vec3(2, 2, 2), position: new Vec3(5, 5, 5)}) .call(() => { console.log('This is a callback'); }) .by(1, {scale: new Vec3(-1, -1, -1), position: new Vec3(-5, -5, -5)}, {easing: 'sineOutIn'}) .start()

Type parameters

  • T

Hierarchy

  • Tween

Index

Constructors

constructor

  • newTween(target?: T | null): Tween

Properties

Private _actions

_actions: Action[] = []

Private _finalAction

_finalAction: Action | null = null

Private _tag

_tag: number = Action.TAG_INVALID

Private _target

_target: T | null = null

Static Private Readonly _tmp_args

_tmp_args: Tween<any>[] | Action[] = []

Methods

Private destroy

  • _destroy(): void

Private union

  • _union(): Action

by

call

  • call(callback: Function): Tween<T>

clone

  • clone(target: T): Tween<T>

delay

  • delay(duration: number): Tween<T>

hide

parallel

removeSelf

repeat

  • repeat(repeatTimes: number, embedTween?: Tween<T>): Tween<T>
  • Add an repeat action. This action will integrate before actions to a sequence action as their parameters.

    Parameters

    • repeatTimes: number

      重复次数

    • Optional embedTween: Tween<T>

      可选,嵌入 Tween

    Returns Tween<T>

repeatForever

  • Add an repeat forever action. This action will integrate before actions to a sequence action as their parameters.

    method

    repeatForever

    Parameters

    • Optional embedTween: Tween<T>

      可选,嵌入 Tween

    Returns Tween<T>

reverseTime

  • Add an reverse time action. This action will integrate before actions to a sequence action as their parameters.

    method

    reverseTime

    Parameters

    • Optional embedTween: Tween<T>

      可选,嵌入 Tween

    Returns Tween<T>

sequence

set

show

start

stop

tag

  • tag(tag: number): this

target

  • target(target: T): Tween<T | undefined>

then

to

union

Static Private wrappedParallel

  • wrappedParallel(...args: Action[] | Tween<any>[]): FiniteTimeAction

Static Private wrappedSequence

  • wrappedSequence(...args: Action[] | Tween<any>[]): ActionInterval

Static stopAll

  • stopAll(): void

Static stopAllByTag

  • stopAllByTag(tag: number, target?: undefined | object): void
  • Stop all tweens by tag

    Parameters

    • tag: number
    • Optional target: undefined | object

    Returns void

Static stopAllByTarget

  • stopAllByTarget(target?: undefined | object): void
  • Stop all tweens by target

    Parameters

    • Optional target: undefined | object

    Returns void

Generated using TypeDoc