Property pRatio
On beginSprite me
pRatio = mySprite.width / mySprite.height
end
repeat while (mySprite.height < member(mySprite.member).height) and
(mySprite.width < member(mySprite.member).width)
mySprite.width = mySprite.width + 5
mySprite.height = mySprite.width * pRatio
updatestage
end repeat
-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED] On Behalf Of Michael
Nadel
Sent: 16 January 2006 14:51
To: [email protected]
Subject: <lingo-l> maintaining proportions
This question has been plauging me for a long time and I'm sure there
must
be a simple answer. Is there a way to make a repeat loop to make a
sprite
grow and shrink in a way that will maintain proportions? In other words,
it's easy to make a perfect box grow in size, but how do you make a
rectangle grow and keep it's proportions while it grows? This is my
code,
but it doesn't work.
repeat while (mySprite.height < member(mySprite.member).height) and
(mySprite.width < member(mySprite.member).width)
mySprite.height = mySprite.height + 5
mySprite.width = mySprite.width + 5
updatestage
end repeat
Thanks for any help!
Michael Nadel
MediArt.Corp
"Creativity is more powerful than knowledge" -- Albert Einstein
***********************************************************************
Tel: (972-2) 5807-454
Email: [EMAIL PROTECTED]
Web: http://www.mediarthome.com
[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!]
[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!]