.scroll(rather than calling
.setPosition()as I had initially thought) I can control the camera how I envisioned in this class. It so far doesn't do much beyond a basic FlxCamera, but will hopefully soon have scrollbar-drawing and mouse-handling code.
package flixel.ui;I was thinking of trying FlxSliders for the scrollbars, but visually I don't think they fit well. That's OK, a basic scrollbar will not be hard to draw. :)
* An area of the screen that has automatic scrollbars, if needed.
* @author Gimmicky Apps
class FlxScrollableArea extends FlxCamera
* Creates a specialized FlxCamera that can be added to FlxG.cameras.
* @param ViewPort the area on the screen, in absolute pixels, that will show content.
* @param Content the area (probably off-screen) to be viewed in ViewPort
public function new(ViewPort:FlxRect, Content:FlxRect)
Std.int( ViewPort.x ),
Std.int( ViewPort.y ),
Std.int( ViewPort.width ),
Std.int( ViewPort.height ),
_bounds = Content;
scroll.x = Content.x;
scroll.y = Content.y;