Hi Roy

Try something like this:

on mResizeRect vSprite, vFactor
  vStartRect = sprite(vSprite).rect
  theScale = float(vStartRect.width) / vStartRect.height
  if vStartRect.width >= vStartRect.height then
    vScale = float(vStartRect.width) / vStartRect.height
    vScaleRect = rect(-1.0 * vScale,-1.0,1.0 * vScale,1.0) * vFactor
  else
    vScale = float(vStartRect.height) / vStartRect.width
    vScaleRect = rect(-1.0,-1.0 * vScale,1.0,1.0 * vScale) * vFactor
  end if
  vNewRect = vStartRect + vScaleRect
  sprite(vSprite).rect = vNewRect
end mResizeRect

its not perfect, there is a slight loss in the proportionality, but unless
this is a severe mission critical piece this should get it working.

vSprite is an integer
vFactor is any factor that you want to scale it by so to speak

anyhow, hope it helps you.

Sincerely

Mark

--------------------------------------------
Mark R. Jonkman
Mark R. Jonkman Consulting
ADDRESS: 20 Windermere Crt., Guelph, ON, CANADA N1E 3L4
PHONE: 519-837-8509
EMAIL: [EMAIL PROTECTED]
--------------------------------------------


[To remove yourself from this list, or to change to digest mode, go to
http://www.penworks.com/LUJ/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