-2

Im trying to get flxSprite to be in the center, but i dont wanna use the preset haxeflixel commands, since i might move it later, so can someone please help?

1 Answers1

2

(FlxG.width / 2, FlxG.height / 2) Is the middle of the screen.

If you're going to place a FlxSprite in the middle of the screen, it should be sprite.x = (FlxG.width / 2) - (sprite.width / 2), sprite. y = (FlxG.height / 2) - (sprite.height / 2).

If you use sprite.screenCenter();, you will still be able to move it later. Unless you use it in your update function, of course.

Rench
  • 76
  • 3