Created
December 5, 2013 20:57
-
-
Save PDeveloper/7813754 to your computer and use it in GitHub Desktop.
Setup with assets that come with the Demo sample. On Neko and Cpp, button rollover button states don't work!
This file contains 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 ; | |
import flash.display.Sprite; | |
import flash.events.Event; | |
import flash.Lib; | |
import ru.stablex.ui.UIBuilder; | |
import ru.stablex.ui.widgets.Button; | |
import ru.stablex.ui.widgets.Floating; | |
/** | |
* ... | |
* @author P Svilans | |
*/ | |
class Main extends Sprite | |
{ | |
var inited:Bool; | |
function init() | |
{ | |
if (inited) return; | |
inited = true; | |
//initialize StablexUI | |
UIBuilder.init( 'ui/android/defaults.xml' ); | |
//register skins | |
UIBuilder.regSkins( 'ui/android/skins.xml' ); | |
//UIBuilder.buildFn( 'ui/example.xml' )().show(); | |
var floating = UIBuilder.create( Floating, { | |
children : [ | |
UIBuilder.create( Button, { | |
text : "this is a button!" | |
}) | |
] | |
}); | |
floating.show(); | |
} | |
/* SETUP */ | |
public function new() | |
{ | |
super(); | |
addEventListener(Event.ADDED_TO_STAGE, added); | |
} | |
function added(e) | |
{ | |
removeEventListener(Event.ADDED_TO_STAGE, added); | |
init(); | |
} | |
public static function main() | |
{ | |
// static entry point | |
Lib.current.stage.align = flash.display.StageAlign.TOP_LEFT; | |
Lib.current.stage.scaleMode = flash.display.StageScaleMode.NO_SCALE; | |
Lib.current.addChild(new Main()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment