Skip to content

getTweensOf(target) tween manager #5260

@pcharest2000

Description

@pcharest2000

Version

  • Phaser Version: Latest
  • Operating system: Linux, Ubunut 20.04
  • Browser: All

Description

getTweensOf(target) only return objects if the tween are active, i.e tweening. if a tween is done this method returns no object. is this the expected behavior?

Example Test Code

import * as Phaser from "phaser";

const sceneConfig: Phaser.Types.Scenes.SettingsConfig = {
active: false,
visible: false,
key: "Test"
};

var squareTest;
var tweenTest;
export class ClockScene extends Phaser.Scene {
constructor() {
super(sceneConfig);
}
public create() {
squareTest = this.add.rectangle(0, 0, 200, 200, 0xffff00)
tweenTest = this.add.tween({
targets: squareTest,
scaleX: 0.2,
scaleY: 0.2,
// angle: Phaser.Math.Between(-360, 360),
yoyo: true,
repeat: 1,
duration: 1000,
paused: true
});

public update(time,delta) {
console.log(this.tweens.getTweensOf(squareTest));
}
}

Additional Information

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions