-
Notifications
You must be signed in to change notification settings - Fork 450
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
Added onStart parameter to FlxTween #1273
Conversation
Also renamed "complete" property to "onComplete"
* dev: Add FlxKey.toString(), closes HaxeFlixel#1258
@@ -540,11 +565,13 @@ class FlxTween implements IFlxDestroyable | |||
} | |||
|
|||
typedef CompleteCallback = FlxTween->Void; | |||
typedef StartCallback = FlxTween->Void; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Might make sense to unify this to a "TweenCallback"?
TweenLite has an onUpdate param as well, do you think it'd be useful here too? |
I thought about that as well. It'd basically be the same as NumTween's tween callback. |
|
Great feedback! I've added an |
Nice! I don't like the redundancy this introduces though. Like menionted,
Thoughts? |
Unless I'm mistaking, that would only work when tweening
Same argument as above; the type of the value would would depend on the type being tweened.
It would be probably, in some cases, be convenient to have access to the current tween value through the |
I vote this one:
|
Hm... yeah, I didn't consider that the type of the value varies. It would be akward to represent a color as a Float - the other option is to add a type parameter to |
NumTween's // NumTween
this.onUpdate = function(fxt:FlxTween):Void { value = start + whatever; };
// ColorTween
this.onUpdate = function(fxt:FlxTween):Void { color.interp() or whatever; };
|
Is there any opposition to merge this? I think it's a good change, even if it doesn't unify the entire tweening system. |
Added onStart parameter to FlxTween
Changes in
FlxTween
:complete
callback parameter inoptions
is now calledonComplete
onStart
callback parameter inoptions
Notice: A few changes need to be made in the
flixel-demos
repository - I'll push those shortly