Advertisement
Guest User

rotation

a guest
Aug 11th, 2017
76
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Haxe 0.43 KB | None | 0 0
  1. for (i in 0 ... points.length)
  2.         {
  3.             var offset : FlxPoint = points[i];
  4.    
  5.             var rot : FlxPoint = new FlxPoint(
  6.             Math.cos(rotAngle) * offset.x  + Math.sin(rotAngle) * offset.y,
  7.             -Math.sin(rotAngle) * offset.x + Math.cos(rotAngle) * offset.y );
  8.            
  9.            
  10.             var pos : FlxPoint = new FlxPoint(point.x + rot.x * 20, point.y + rot.y * 20);
  11.            
  12.             var t : FlxText = new FlxText(pos.x, pos.y, 0, Std.string(i), 16);
  13.             t.draw();
  14.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement