Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package {
- import flash.display.Bitmap;
- import flash.display.BitmapData;
- import flash.display.Sprite;
- import flash.events.Event;
- import flash.geom.ColorTransform;
- /**
- * @author netgrind
- * PRETTY COLORS
- * USE FOR WHATEVER AT OWN RISK
- * Example swf http://netgrindgames.com/trips/CircleFunLines.swf
- */
- public class CircleLines extends Sprite {
- public var w:int = 1000;//width of swf
- public var h:int = 600;//height of swf (weird fucking ratio...)
- public var large:int = 300;//outer circle radius
- public var small:int = 60;//inner circle radius
- public var bd:BitmapData;//for drawing the graphics to, keep the shape count low.
- public var s:Sprite;//for drawing on
- public var o:int = 0;//frame counter
- public var deg:int = 60;//degrees inner circle is shifted
- public function CircleLines() {
- super();
- bd = new BitmapData(w, h, true, 0);
- addChild(new Bitmap(bd,'never',true));
- s = new Sprite();
- addEventListener(Event.ENTER_FRAME, update);
- }
- public function update(e:Event):void {
- deg = (mouseX - w * .5) * .5;
- small = mouseY;
- o += 2
- for (var i:Number = 0; i < 360; i+=5) {
- s.graphics.lineStyle(1,UtilsArt.HSBtoHEX(i+o,75,75));
- s.graphics.moveTo(Math.sin(i*Math.PI/180)*large+w*.5, Math.cos(i*Math.PI/180)*large+h*.5);
- s.graphics.lineTo(Math.sin((i+deg)*Math.PI/180) * small*.5 + w * .5, Math.cos((i+deg)*Math.PI/180) * small*.5 + h * .5);
- }
- bd.draw(s);
- bd.colorTransform(bd.rect, new ColorTransform(1, 1, 1, .9));
- s.graphics.clear();
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement