Since I just butted my head up against this, I thought I'd share this with 
everyone:

the .width and .height properties of a sprite on stage are of the 
un-rotated image.  If you need the real 'width' of the rotated sprite, you 
have to do the math your self, subtracting the left from right, etc.

Below is an example, of a long "menubar" shaped sprite, which when rotated 
45 and then 90 degrees, still reports the width and height that the 
unrotate image had.

Only stumped me for a day or two of heavy trigonometry.

-- Welcome to Director --
put sprite(1).rect
-- rect(237, 229, 680, 265)
put sprite(1).width, sprite(1).height
-- 443 36
put sprite(1).rotation
-- 0.0000
sprite(1).rotation = 45
put sprite(1).rotation
-- 45.0000
put sprite(1).rect
-- rect(289, 78, 628, 417)
put sprite(1).width, sprite(1).height
-- 443 36
sprite(1).rotation = 90
put sprite(1).rotation
-- 90.0000
put sprite(1).rect
-- rect(439, 26, 477, 469)
put sprite(1).left, sprite(1).top, sprite(1).right, sprite(1).bottom
-- 439 26 477 469
put sprite(1).width, sprite(1).height
-- 443 36
sprite(1).width = sprite(1).width * 0.25
put sprite(1).rect
-- rect(440, 191, 476, 303)
sprite(1).height = sprite(1).height * 0.25
put sprite(1).rect
-- rect(454, 191, 463, 303)


Now, if you'll excuse me, I've got to go call my highschool trig teacher 
and tell her that I lowe her.

roymeo

-----
Roy Crisman
Senior Macromedia Programmer
(585)724-4054
[EMAIL PROTECTED]

[To remove yourself from this list, or to change to digest mode, go to 
http://www.penworks.com/lingo-l.cgi  To post messages to the list, email 
[EMAIL PROTECTED]  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to