Skip to content

Instantly share code, notes, and snippets.

@rymawby
Last active December 19, 2015 13:59
Show Gist options
  • Select an option

  • Save rymawby/5966265 to your computer and use it in GitHub Desktop.

Select an option

Save rymawby/5966265 to your computer and use it in GitHub Desktop.
Super simple as3 VBox.
package com.wegoodhq.view.component.ui.layout
{
import flash.display.DisplayObject;
public class VBox extends SelectableElement
{
private var _spacing:int;
private var _currentY:int = 0;
public function VBox(spacing:int = 0)
{
_spacing = spacing;
}
override public function addChild(child:DisplayObject) : DisplayObject
{
child.y = _currentY;
_currentY += (child.height + _spacing);
return super.addChild(child);
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment