[Resolved] Image sheets and scaling (xScale/yScale) problem

Am currently changing one of my apps to use image sheets instead of individual images to help reduce the amount of images down.

But am having a problem with scaling the image on screen using xScale and yScale.

My image in PS is say 450 x 450, 3 tiles across and 3 down. So each image square is 150 x 150 (transparent background), my sprites inside each square are all different sizes but I need the 150 x 150 so they have plenty of room around them. The reason for this is my app is a drag and drop app, so having plenty of space around a image makes it easier to drag.

Trouble is if I scale the image to say 0.3 and then scale it back to 1, the image is scaled wrong. It’s like Corona is taking the actual pixels of the sprite and making it 150 x 150.

If you look at the Apple image (on left) at the top of this blog post -

http://www.coronalabs.com/blog/2012/05/29/how-to-use-bitmap-masks/

That is how I have my images, so the user can easily grab that apple by clicking anywhere on the image. If I reduce that image using xScale/yScale and enlarge it, it seems to ignore the transparent part and only effect the image data. I then have a really weird looking Apple.

EDIT: This was my fault, wasn’t giving the newImageRect the right size!

Dave [import]uid: 117617 topic_id: 30025 reply_id: 330025[/import]