How do I resize by cropping/expanding during play?

0 favourites
From the Asset Store
Simple resize and rotate events for any sprite, quick and easy event sheet that you can use for your own projects.
  • I think it's to do with the fact that numbers are not always exact. For example another work-around I managed was this:

    It seemed to work fine. So the issue is that cards were not always at exactly the correct values, which I remember reading about somewhere in the manual, so they would briefly meet your condition and flick between layouts. When checking whether positions/values match, you should usually leave a little leeway, then if it falls within the acceptable margin, force set the values to exactly what they should be.

  • You can see from my code that the conditions set crop_ratio to crop_ratio_new as a last thing when the cropping function finishes, so the values are actually most of the time exactly the same, and only differ when the whole card cropping process is activated by setting a new crop_new value. When cards are spawned both values are also same (0).

    But your post did give me the idea so I DID find a solution to the problem that doesn't require any extra variables or other shifty weirdness. It was probably a picking issue since shifting the "for each" condition around fixes it.

    I still don't really know why exactly it didn't work the way I wanted in the first place, but I assume the whole condition needs to be checked specifically for each card. But at least now it works with minimal code and looks clean. Here's the final version:

  • Dude it's a work of art! Apparently you've done better work than Riot could manage XD Thank you very much for your effort on this :)

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • Thanks,

    It will be interesting to see the card game if you finish it.

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)