Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel grandchild tweens #2354

Merged
merged 4 commits into from
Jul 22, 2021
Merged

Conversation

Geokureli
Copy link
Member

@Geokureli Geokureli commented Jul 21, 2021

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

The tween above can already be cancelled, via:

FlxTween.cancelTweensOf(camera.scroll);

but because the camera is the actual tween target, it should also be cancelled with:

FlxTween.cancelTweensOf(camera);

Whereas tween(camera.scroll, {y: 500}, 1.0) is not a tween on camera, so it must be cancelled with cancelTweensOf(camera.scroll) or cancelTweensOf(camera, ['scroll.y']).

@@ -39,16 +39,19 @@ class FlxCameraTest extends FlxTest
@Test
function testDefaultCameras():Void
{
Assert.areEqual(FlxG.cameras.defaults, FlxCamera.defaultCameras);
@:privateAccess
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why start using privateAccess in here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

to remove the deprecation warnings

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

That feels very hacky. I think I'd rather have the deprecation warnings.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

both seem hacky, but sure

@Gama11 Gama11 merged commit 3cb8c75 into HaxeFlixel:dev Jul 22, 2021
@Geokureli Geokureli deleted the cancel_grandchild_tweens branch January 24, 2022 20:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants