Trail effect by default



  • Hello,

    I have started a new project with Flixel. So far I only have a falling object. It is just an FlxSprite with a rectangle created with makeGraphic(40, 15, FlxColor.BROWN). I give it an acceleration and a maxVelocity to move it from top to bottom. However, it has a trail effect as shown below, and even there's not many objects in the state, it seems to have frame skips. I know that this effect may occur because of transparent background. I set it with this.bgColor = 0x5599ffff, so it is fully opaque.

    trail issue

    I build for html5 target with debug option. I run it with firefox.

    How can I avoid this effect? Is frame skip normal at this stage?


  • administrators

    Could you provide some code that reproduces the issue?



  • I reproduced it with this code:

    class Main extends Sprite
    {
    	public function new()
    	{
    		super();
    		addChild(new FlxGame(0, 0, ReproduceState));
    	}
    }
    
    class ReproduceState extends FlxState
    {
    	private var fallSprite:FlxSprite;
    
    	override public function create():Void 
    	{
    		super.create();
    		
    		bgColor = 0x5599ffff;
    		
    		fallSprite = new FlxSprite(300, 0);
    		fallSprite.makeGraphic(30, 30, FlxColor.BROWN);
    		fallSprite.acceleration.set(150, 300);
    		fallSprite.maxVelocity.set(150, 300);
    		
    		add(fallSprite);
    	}
    }
    

    Edit: I couldn't reproduce the frame skip issue with this code.


  • administrators

    0x5599ffff is not fully opaque, colors are in ARGB format. The trail disappears with 0xFF99ffff.



  • I think he messed up the hex code
    The color hex code's format is 0xAARRGGBB not 0xRRGGBBAA


  • administrators

    @DleanJeans How is that different from what I said? ;)



  • Oh thanks, I missed that :o


Log in to reply
 

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.