Darakan
12-17-2008, 02:32 PM
I'm using localToGlobal but I get messed up coordinates for some reason.
var p : Point = player.gun.localToGlobal(new Point(player.gun.x,player.gun.y));
"gun" is a DisplayObject telling where the barrel of the gun is, and the coordinates I need are of the stage and not a different DisplayObject. What I get is that the X values are more large when gun.x is more far from (0,0), and the Y values become narrow and are put above the requires coordinate.
It's not the first time I'm using this method but just now when I need it most (a project due out in a few hours), I have this problem. Will be grateful for anyone who helps!
var p : Point = player.gun.localToGlobal(new Point(player.gun.x,player.gun.y));
"gun" is a DisplayObject telling where the barrel of the gun is, and the coordinates I need are of the stage and not a different DisplayObject. What I get is that the X values are more large when gun.x is more far from (0,0), and the Y values become narrow and are put above the requires coordinate.
It's not the first time I'm using this method but just now when I need it most (a project due out in a few hours), I have this problem. Will be grateful for anyone who helps!