Advertisement
Konsnos

Constant drawing in Starling Shape test

Feb 12th, 2014
174
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. package
  2. {
  3.     import flash.display.Bitmap;
  4.     import starling.core.Starling;
  5.     import starling.display.Image;
  6.     import starling.display.Shape;
  7.     import starling.display.Sprite;
  8.     import starling.events.EnterFrameEvent;
  9.     import starling.extensions.pixelmask.PixelMaskDisplayObject;
  10.     import starling.textures.Texture;
  11.    
  12.     /**
  13.      * ...
  14.      * @author Konstantinos Egkarchos
  15.      */
  16.     public class ShapeTest extends Sprite
  17.     {
  18.         public function ShapeTest()
  19.         {
  20.             super();
  21.            
  22.             _testShape = new Shape();
  23.             addChild(_testShape);
  24.            
  25.             addEventListener(EnterFrameEvent.ENTER_FRAME, onEnterFrame);
  26.         }
  27.        
  28.         private function onEnterFrame(e:EnterFrameEvent):void
  29.         {
  30.             _testShape.graphics.beginFill(0x0, 1);
  31.             _testShape.graphics.drawCircle(Starling.current.nativeStage.mouseX, Starling.current.nativeStage.mouseY, 50);
  32.             _testShape.graphics.endFill();
  33.         }
  34.        
  35.         private var _testShape:Shape;
  36.     }
  37. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement