Hello,
I'm trying to add a rectangle for showing bounding box limits around a sprite.
Unfortunately, the bounding box is displayed only at the first frame of the sprite animation, and disappears when the rest of the animation is played.
Then, when the sprite comes back to idle state (first frame), the rectangle is visible again.
I've modified the «Revenge» demo to show you the problem.
You can find the demo here : flixel-demos/1,1,2/Platformers/Revenge
I've did the modification in "PlayState.hx", and put it just before the super.update() of the update() function.
// add this at the beginning : using flixel.util.FlxSpriteUtil;
var org_x = _player.offset.x;
var org_y = _player.offset.y;
var ls:LineStyle = {thickness:1, color:0xffffffff};
_player.drawLine( org_x,org_y, _player.width+org_x, org_y, ls);
_player.drawLine( org_x,org_y, org_x, _player.height+org_y,ls);
_player.drawLine( _player.width+org_x, org_y, _player.width+org_x, _player.height+org_y,ls);
_player.drawLine( org_x,_player.height+org_y-1, _player.width+org_x, _player.height+org_y-1,ls);
Thank you for your help.