FlxBar CreateColoredFilledBar?



  • How am i supposed to use createColoredFilledBar() function to create a custom colored FlxBar?
    I want a red colored bar instead of the normal green.



  • @joel_linder

    This is a simple example. You can do much more, such as gradient bar, add border. This will make a red bar with dark red when empty.

    var myBar = new FlxBar();		
    myBar.createFilledBar(0xFF660000, 0xFFFF0000);
    

    this will give you a gradient bar with a yellow border, if you're interested.

    myBar.createGradientBar([0xFF006600, 0xFF666600, 0xFF660000], [0xFF00FF00, 0xFFFFFF00, 0xFFFF0000], 1, 180, true, 0xFFFFFF00);
    


  • @dean
    Thanks a lot! Works perfectly!


Log in to reply