Replies: 2 comments 1 reply
-
I think it's cuz you defined my proposed changes would be to define |
Beta Was this translation helpful? Give feedback.
1 reply
-
When it's public override function handleEvent(data:SongEventData):Void {
if (PlayState.instance == null || PlayState.instance.currentStage == null) return;
// Does nothing if we are minimal mode.
if (PlayState.instance.isMinimalMode) return;
var duration:Float = data.getFloat('duration') != null ? data.getFloat('duration') : DEFAULT_DURATION;
var toAngle:Float = data.getFloat('angle') != null ? data.getFloat('angle') : DEFAULT_ANGLE;
var ease:String = data.getString('ease') != null ? data.getString('ease') : DEFAULT_EASE;
var easeFunction:Null<Float->Float> = null;
switch (ease) {
case 'INSTANT':
// Cancel the tween here, so it doesn't tween (haven't tested it yet)
cameraTween.cancel();
// It's a snap!
PlayState.instance.camGame.angle = toAngle;
default:
easeFunction = ReflectUtil.getAnonymousField(FlxEase, ease);
if (easeFunction == null)
{
trace('Invalid ease function: $ease');
return;
}
rotateCamGame(toAngle, duration, easeFunction);
}
} Basically, there's no need to tween it. Only use a tween if the duration isn't zero. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
For context I wanted to create a custom event that rotates the camera with ease effects much like base game
I have no clue what causes this error, I've reread it several times for a missing semicolon but I got nothing
V0.5.3
Beta Was this translation helpful? Give feedback.
All reactions