Last active
December 19, 2015 13:59
-
-
Save rymawby/5966265 to your computer and use it in GitHub Desktop.
Super simple as3 VBox.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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