Flixel Power Tools FlxScrollingText

Back to the Flixel Power Tools

It seemed only natural to take the FlxBitmapFont and the FlxScrollZone tools and combine them – and this is the result! You can create a scrolling text field with one line of code. Pass it an FlxBitmapFont, give it a Rectangle in which to scroll and away it goes. You have control over the scroll speed, steps, the text that is scrolled (which can be updated in real-time), set the scroller to wrap or destroy itself once finished and only scroll if visible in an active camera.

Screen Shot

Code Example

//	Create an FlxBitmapFont in the usual way
font = new FlxBitmapFont(AssetsRegistry.bluepinkFontPNG, 32, 32, FlxBitmapFont.TEXT_SET2, 10);

//	Then create a scrolling text using it - this is just an FlxSprite, you can move it around, collide with it, all the things you can do with a sprite
scroller = FlxScrollingText.add(font, new Rectangle(14, 40, 292, 32), 1, 0, "WELCOME!   ");

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

Make yourself heard