2 Replies Latest reply on Jun 5, 2006 4:39 AM by Elie85

    scaleMode

    Elie85
      im trying to scale sprite on intersection but it seems my code is not working. here's the code:

      on scaleMovie
      if sprite 5 intersects 2 then
      sprite(2).scale = 50
      end if
      end
        • 1. Re: scaleMode
          Level 7
          I'm not familier with scale as in >> sprite(2).scale = 50



          sprite(2).rect - sprite(2).rect / 2 -- would scale size (and screen
          position)



          -- to preserve center point, scale width and height, I don't recall if
          width an height may be set.


          sprite(2).width - sprite(2).width / 2
          sprite(2).height - sprite(2).height / 2




          -- the longer Rect manipulation for guranteed to work

          R = sprite(2).rect
          R.right = R.left + R/width / 2
          R.bottom = R.top + R/height / 2
          sprite(2).rect = R -- apply modified rect back to sprite
          • 2. Re: scaleMode
            Elie85 Level 1
            thanks it seems it works quiet well