-180 to 180
- Started
- Last post
- 8 Responses
- level2b
Anyone know the math to convert the Flash rotation to be from 0-360 degrees? (instead of the -180 to 180)
- enjine0
it gets converted automatically.
if you say mc._rotation = 190, flash will convert the number for you.
- level2b0
hmm, I'm doing an if/else to watch the rotation as an object spins, but after 180 degrees, it converts to a negative number..
- enjine0
oh, you want to *read* the value.
check it:
mc.onEnterFrame = function(){
var r = this._rotation++;
if(r < 0){
r = 180 + (180+r);
}
trace(r);
}
- level2b0
exactly what I needed, thanks!
- torres0
you could just multiply it by "-1"
- level2b0
that wouldn't work, moving clockwise after 180 degrees it reduces in value..
180 degrees + 1 = -179
The earlier code works though..
- bulletfactory0
does simply adding 180 to everything work?
- enjine0
no, that would count back to zero.