Use FlxSprite.makeGraphic()
to create a FlxSprite
of a solid color.
// sprite's graphic will be made into a 128px by 64px solid red rectangle
sprite.makeGraphic(128, 64, FlxColor.RED);
Use FlxSprite.makeGraphic()
to create a FlxSprite
of a solid color.
// sprite's graphic will be made into a 128px by 64px solid red rectangle
sprite.makeGraphic(128, 64, FlxColor.RED);
package;
import flixel.FlxG;
import flixel.FlxSprite;
import flixel.FlxState;
import flixel.util.FlxColor;
class PlayState extends FlxState
{
override function create()
{
super.create();
var sprite = new FlxSprite();
sprite.makeGraphic(128, 64, FlxColor.RED);
sprite.screenCenter();
add(sprite);
}
}