Created
January 12, 2014 15:16
-
-
Save Beeblerox/8385887 to your computer and use it in GitHub Desktop.
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
_point.x = x; | |
_point.y = y; | |
var csx:Float = 1; | |
var ssy:Float = 0; | |
var ssx:Float = 0; | |
var csy:Float = 1; | |
var x1:Float = (_origin.x - frame.center.x) * scale.x; | |
var y1:Float = (_origin.y - frame.center.y) * scale.y; | |
var x2:Float = x1; | |
var y2:Float = y1; | |
// transformation matrix coefficients | |
var a:Float = csx; | |
var b:Float = ssx; | |
var c:Float = ssy; | |
var d:Float = csy; | |
var radians:Float = -angle * FlxAngle.TO_RAD; | |
_sinAngle = Math.sin(radians); | |
_cosAngle = Math.cos(radians); | |
_angleChanged = false; | |
cos = _cosAngle; | |
sin = _sinAngle; | |
csx = cos * _scale.x; | |
ssy = sin * _scale.y; | |
ssx = sin * _scale.x; | |
csy = cos * _scale.y; | |
x2 = x1 * cos + y1 * sin; | |
y2 = -x1 * sin + y1 * cos; | |
a = csx; | |
b = ssx; | |
c = ssy; | |
d = csy; | |
currDrawData[currIndex++] = _point.x - x2; | |
currDrawData[currIndex++] = _point.y - y2; | |
currDrawData[currIndex++] = tileID; | |
currDrawData[currIndex++] = a; | |
currDrawData[currIndex++] = -b; | |
currDrawData[currIndex++] = c; | |
currDrawData[currIndex++] = d; | |
if (isColored) | |
{ | |
currDrawData[currIndex++] = _red; | |
currDrawData[currIndex++] = _green; | |
currDrawData[currIndex++] = _blue; | |
} | |
currDrawData[currIndex++] = alpha; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment