Flixel Power Tools FlxGradient

Back to the Flixel Power Tools

Gradients are a staple of most retro games, usually used for pretty sky-backdrops or to fill in game objects or text panels. This class provides an extremely easy way to create those. It can generate an FlxSprite filled with the gradient, or overlay a gradient onto an existing FlxSprite (or portion of it). It can also generate an Array full of gradient values for use outside the class. Just give it an array of colour values, and it will do the rest. Gradients can also be “chunked”, making them less smooth (and more retro!) and rotated to any angle.

Screen Shot

Code Example

Recent Flixel Power Tool Posts

  1. Flixel Power Tools v1.9 Released
  2. Flixel Power Tools v1.8 Released - Let's get clicky
  3. Flixel Power Tools v1.7 - Kaboom!
  4. Flixel Power Tools v1.6 released including FlxControl
  5. Flixel Power Tools v1.5 - A monster of an update!
  6. FlxScreenGrab and FlxScrollZone added to Flixel Power Tools
  7. Flixel Power Tools v1.3 - Now Flixel 2.5 compatible!
  8. FlxHealthBar added to Flixel Power Tools

3 Responses

Leave a comment
  • Bennett
    July 14th 2011 at 12:35 am

    This one totally doesn’t work for me when I use that code snippet and your latest downloadable package. Just renders nothing.

  • July 14th 2011 at 1:12 am

    Sorry the colour values are wrong in the code above. They need to be in 0xAARRGGBB format. It works in the Test Suite examples, but have modified the post above to reflect this.

  • Bennett
    July 14th 2011 at 1:40 am

    Ah works now, thanks.

Make yourself heard