Skip to content

Commit

Permalink
Update CoolUtil.hx
Browse files Browse the repository at this point in the history
  • Loading branch information
VMan-2002 committed Dec 7, 2023
1 parent b315f4d commit d90b19f
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions source/CoolUtil.hx
Original file line number Diff line number Diff line change
Expand Up @@ -644,6 +644,24 @@ class CoolUtil
}
return null;
}

public static function fastCreateSparrowSprite(?x:Float = 0, ?y:Float = 0, image:String, ?sprite:Null<FlxSprite> = null) {
if (sprite == null)
sprite = new FlxSprite(x, y);
else
sprite.setPosition(x, y);
sprite.frames = Paths.getSparrowAtlas(image);
return sprite;
}

public static function fastCreateGridSprite(?x:Float = 0, ?y:Float = 0, image:String, ?tileWidth:Int = 16, ?tileHeight:Int = 16, ?sprite:Null<FlxSprite> = null) {
if (sprite == null)
sprite = new FlxSprite(x, y);
else
sprite.setPosition(x, y);
sprite.loadGraphic(image, true, tileWidth, tileHeight);
return sprite;
}
}

class MultiStepResult {
Expand Down

0 comments on commit d90b19f

Please sign in to comment.