added root

This commit is contained in:
2013-08-27 09:25:41 +02:00
parent 51ae8e2931
commit 752d0dd413
11 changed files with 157 additions and 29 deletions

View File

@@ -1,5 +1,8 @@
package examples;
import haxework.gui.Root;
import haxework.gui.core.HAlign;
import haxework.gui.core.VAlign;
import flash.Lib;
import haxework.gui.skin.ColorSkin;
import haxework.gui.View;
@@ -11,15 +14,13 @@ import haxework.gui.IGroupView;
class ViewExample {
public static function main() {
View.updater.stage = Lib.current.stage;
var group:IGroupView<Sprite> = new GroupView();
group.width = 400;
group.height = 400;
group.layoutVAlign = VAlign.MIDDLE;
group.layoutHAlign = HAlign.CENTER;
group.skin = new ColorSkin(0xffff00);
var view:IView<Sprite> = new View();
view.width = 200;
view.height = 200;
view.pWidth = 80;
view.pHeight = 80;
view.skin = new ColorSkin(0xff0000);
group.addView(view);
view = new View();
@@ -33,5 +34,7 @@ class ViewExample {
view.skin = new ColorSkin(0x0000ff);
group.addView(view);
Lib.current.addChild(group.content);
new Root(group);
}
}