Posted By

adrianparr on 08/11/10


Tagged

centre zero circle center graphics draw dot as3 origin middle beginfill endfill drawcircle


Versions (?)

Who likes this?

4 people have marked this snippet as a favorite

Nikolai
PixelJuice
tspitzr
albertomori


AS3 Draw a Dot at 0,0 to Show the Centre Of a DisplayObject


 / Published in: ActionScript 3
 

A handy little function to dynamically draw a black dot on the stage (or displayObject). This can be useful if you want to see where 0,0 is located.

  1. private function showCentre($doc:DisplayObjectContainer = null, $colour:uint = 0x000000, $radius:Number = 2):void
  2. {
  3. var dot:Shape = new Shape();
  4. dot.graphics.beginFill($colour);
  5. dot.graphics.drawCircle(0, 0, $radius);
  6. dot.graphics.endFill();
  7. $doc.addChild(dot);
  8. }

Report this snippet  

You need to login to post a comment.