Files
CodenameEngine/source/funkin/scripting/events/PlayAnimEvent.hx
T
2022-12-31 04:11:50 +01:00

73 lines
1.8 KiB
Haxe

package funkin.scripting.events;
class PlayAnimEvent extends CancellableEvent {
/**
Name of the animation that's going to be played.
**/
public var animName:String;
/**
Whenever the animation will be forced or not.
**/
public var force:Bool;
/**
Whenever the animation will play in reverse or not
**/
public var reverse:Bool;
/**
The frame at which the animation will start playing
**/
public var startingFrame:Int = 0;
/**
Context of the animation
**/
public var context:PlayAnimContext;
public function new(animName:String, force:Bool, reverse:Bool, startingFrame:Int, context:PlayAnimContext) {
super();
this.animName = animName;
this.force = force;
this.reverse = reverse;
this.startingFrame = startingFrame;
this.context = context;
}
}
/**
Contains all contexts possible for `PlayAnimEvent`.
**/
@:enum
abstract PlayAnimContext(String) {
/**
No context was given for the animation.
The character won't dance until the animation is finished
**/
var NONE = null;
/**
Whenever a note is hit and a sing animation will be played.
The character will only dance after their holdTime is reached.
**/
var SING = "SING";
/**
Whenever a dance animation is played.
The character's dancing wont be blocked.
**/
var DANCE = "DANCE";
/**
Whenever a note is missed and a miss animation will be played.
Only for scripting, since it has the same effects as SING.
**/
var MISS = "MISS";
/**
Locks the character's animation.
Prevents the character from dancing, even if the animation ended.
**/
var LOCK = "LOCK";
}