I create a quick LayoutHelper to assist in laying out lots of controls: http://blog.killerspaz.com/2012/04/02/starling-foxholecontrols-layouthelper/
Keep in mind, it's simple, but supports the following:
* Global container padding
* Gapsize
* Horizontal and Vertical "Layout"
* Flow - whether to create a new row/column or just infinitely lay out a single direction (default = true)
Usage is simple...
* In a FoxholeControl::initialize(), create a new instance and pass self into it:
override protected function initialize():void { super.initialize(); this._layoutHelper = new LayoutHelper(this); this._layoutHelper.direction = LayoutHelper.DIRECTION_VERITCAL; //this._layoutHelper.allowFlow = false; ...
* In FoxholeControl::draw(), simply put:
override protected function draw():void { super.draw(); this._layoutHelper.layout(); }
I hope this helps someone, it's shortened my logic up quite a bit since I no longer have to do math based on each and every component, and can just create quick containers!