package game.ui.console; import engine.HProfiler; import engine.ui.UIPane; import engine.ui.UIElement; import openfl.text.TextField; import openfl.display3D.textures.Texture; import openfl.display.Sprite; class ConsolePane extends Sprite{ public function new(){ super(); var testPane:UIPane = new UIPane("test",{height:800,width:600}); testPane.layout = VERTICAL; var titlebarPane:UIPane = new UIPane("titlebar", {height:32, width: 600}); titlebarPane.align = START; titlebarPane.layout = HORIZONTAL; var inputPane:UIPane = new UIPane("inputbar", {height:32, width: 600}); inputPane.align = END; inputPane.layout = HORIZONTAL; var outputPane:UIPane = new UIPane("output pane", {height: 32, width: 600}); outputPane.align = START; outputPane.dimensions.expandBehavior = STRETCH; HProfiler.startProfiling("ui_resize"); testPane.width = 1000; HProfiler.stopProfiling("ui_resize"); testPane.addChild(titlebarPane); testPane.addChild(inputPane); testPane.addChild(outputPane); var textField:TextField = new TextField(); textField.background = true; textField.backgroundColor = 0x00ff00; var testInputElement:UIElement = new UIElement("inputelem", {height: 32, width: 300},textField); testInputElement.dimensions.expandBehavior = STRETCH; testInputElement.padding = {x: 8, y: 8}; var inputButtonPane:UIPane = new UIPane("submit button", {height: 32, width: 32}); inputButtonPane.align = END; var inputFieldPane:UIPane = new UIPane("input field", {height: 32, width: 3}); inputFieldPane.align = START; inputFieldPane.dimensions.expandBehavior = STRETCH; inputPane.addChild(inputButtonPane); inputPane.addChild(inputFieldPane); //inputFieldPane.addChild(testInputElement); addChild(testPane.sprite); } }