Skip to content

Commit

Permalink
FlxAnimation: make frameRate a Float (#2252)
Browse files Browse the repository at this point in the history
  • Loading branch information
Geokureli authored Apr 9, 2020
1 parent 1e4eed2 commit 1f57c6e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions flixel/animation/FlxAnimation.hx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ class FlxAnimation extends FlxBaseAnimation
/**
* Animation frameRate - the speed in frames per second that the animation should play at.
*/
public var frameRate(default, set):Int;
public var frameRate(default, set):Float;

/**
* Keeps track of the current frame of animation.
Expand Down Expand Up @@ -77,7 +77,7 @@ class FlxAnimation extends FlxBaseAnimation
* @param FlipX Whether or not the frames of this animation are horizontally flipped.
* @param FlipY Whether or not the frames of this animation are vertically flipped.
*/
public function new(Parent:FlxAnimationController, Name:String, Frames:Array<Int>, FrameRate:Int = 0, Looped:Bool = true, FlipX:Bool = false,
public function new(Parent:FlxAnimationController, Name:String, Frames:Array<Int>, FrameRate:Float = 0, Looped:Bool = true, FlipX:Bool = false,
FlipY:Bool = false)
{
super(Parent, Name);
Expand Down Expand Up @@ -211,7 +211,7 @@ class FlxAnimation extends FlxBaseAnimation
return new FlxAnimation(Parent, name, frames, frameRate, looped, flipX, flipY);
}

function set_frameRate(value:Int):Int
function set_frameRate(value:Float):Float
{
delay = 0;
frameRate = value;
Expand Down
2 changes: 1 addition & 1 deletion flixel/animation/FlxAnimationController.hx
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ class FlxAnimationController implements IFlxDestroyable
* @param FlipX Whether the frames should be flipped horizontally.
* @param FlipY Whether the frames should be flipped vertically.
*/
public function add(Name:String, Frames:Array<Int>, FrameRate:Int = 30, Looped:Bool = true, FlipX:Bool = false, FlipY:Bool = false):Void
public function add(Name:String, Frames:Array<Int>, FrameRate:Float = 30, Looped:Bool = true, FlipX:Bool = false, FlipY:Bool = false):Void
{
// Check _animations frames
var framesToAdd:Array<Int> = Frames;
Expand Down

0 comments on commit 1f57c6e

Please sign in to comment.