You would be better to multiply (scale) rather than adding

Try multiplying by 1.1 every loop but remember to round the value
up/convert to int again!

-----Original Message-----
From: Michael Nadel [mailto:[EMAIL PROTECTED] 
Sent: 16 January 2006 14:51
To: lingo-l@lists.fcgnetworks.net
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
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]).
Lingo-L is for learning and helping with programming Lingo.  Thanks!]


-- 
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom
they are addressed.

If you have received this email in error please notify the
originator of the message. This footer also confirms that this
email message has been scanned for the presence of computer viruses.

Any views expressed in this message are those of the individual
sender, except where the sender specifies and with authority,
states them to be the views of DA Group.


[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 
lingo-l@penworks.com  (Problems, email [EMAIL PROTECTED]). Lingo-L is for 
learning and helping with programming Lingo.  Thanks!]

Reply via email to