Skip to content

Allow cancelTweensOf to cancel tweens on child properties #2316

Closed
@Geokureli

Description

FlxTween allows tweens on child properties of the supplied object, like the following:

FlxTween.tween(camera, {'scroll.y': 500}, 1.0);

To cancel the tween above, one needs to do the following:

hxFlxTween.cancelTweensOf(camera.scroll);

I suggest that because the tween was added to the camera, we should allow devs to cancel it via:

hxFlxTween.cancelTweensOf(camera);

The tween was added to the camera, specifically, so it's natural to think that it can be cancelled the same way. The tween has a reference to both camera.scroll and camera, so it's not difficult, and I don't think this will introduce any new confusions with cancelling tweens.

I'll have a PR soon (been busy/lazy, lately) but I plan to just check if (_object == object) in this function

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

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