Closed dresch86 closed 9 years ago
You can create Floating
widget and attach your login window to it.
Something like this:
var floating = UIBuilder.create(Floating, {/* setup properties */});
var login = /* create login window */
floating.addChild(login);
floating.show()
By default Floating
is added directly to Lib.current.stage
and resized on each stage resize.
I'm using the XML route and have the following from the samples section:
<?xml version="1.0" encoding="UTF-8"?>
<Floating name="'popup'" widthPt="100" heightPt="100" skin:Paint-color="0x333333">
<VBox widthPt="90" childPadding="10" padding="10" skin:Paint-color="0x333333" skin:Paint-corners="[10]">
<Text widthPt="90" label-wordWrap="true" text="'pop'" />
<Button text="'OK'" on-click="$this.getParent('popup').free();"/>
</VBox>
</Floating>
The only different from the samples section is I don't have a skin named "popup." The only thing I see is a blank white screen. There are no text boxes or buttons. Any ideas?
Your xml seems ok. Can you show the code you use to display it?
package;
import openfl.Lib;
import openfl.Assets;
import openfl.text.TextFieldAutoSize;
import openfl.display.Stage;
import openfl.display.Sprite;
import openfl.text.TextField;
import openfl.text.TextFieldType;
import ru.stablex.ui.UIBuilder;
class Main extends Sprite
{
private var spLoginForm:Sprite;
public function new()
{
super();
Lib.current.stage.addChild(this);
UIBuilder.init();
addChild( UIBuilder.buildFn('ui.xml')() );
}
}
For Floating
widgets instead of addChild( UIBuilder.buildFn('ui.xml')() )
you need to UIBuilder.buildFn('ui.xml')().show()
Awesome! Got it working now! Thanks!
I am working on making a login portal and would like for it to be centered on the screen even if the window is resized. What is the best way to accomplish this? I've tried setting the .h and .w using the on-resize event but the column layout does not resize.