Created
August 31, 2012 17:34
-
-
Save k0t0vich/3556240 to your computer and use it in GitHub Desktop.
Similar test
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
class Main extends Sprite | |
{ | |
private var shape:Shape; | |
public function new() | |
{ | |
super(); | |
#if iphone | |
Lib.current.stage.addEventListener(Event.RESIZE, init); | |
#else | |
addEventListener(Event.ADDED_TO_STAGE, init); | |
#end | |
} | |
private function init(e) { | |
shape = new Shape(); | |
shape.graphics.lineStyle(1, 0xFF0000); | |
shape.graphics.beginFill(0x00FF00); | |
shape.graphics.drawCircle(0, 0, 10); | |
shape.graphics.endFill(); | |
this.addChild(shape); | |
shape.x = Lib.current.stage.stageWidth / 2; | |
shape.y = 200; | |
addEventListener(Event.ENTER_FRAME, enterFraneHandler); | |
} | |
private function enterFraneHandler(e:Event):Void { | |
shape.x = mouseX; | |
shape.y = mouseY; | |
} | |
static public function main() | |
{ | |
var stage = Lib.current.stage; | |
stage.scaleMode = nme.display.StageScaleMode.NO_SCALE; | |
stage.align = nme.display.StageAlign.TOP_LEFT; | |
Lib.current.addChild(new Main()); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment