Display only a part of an image

Hi everyone

Please forgive me if this is mentioned in the documentation.

I am working on several projects that involve importing photos from the iOS photo library, and creating several display objects of parts from the image.

One game that I am working on is a 15 slider puzzle, where the pieces are made up of a photo taken from the device.

Thanks for the help. [import]uid: 34103 topic_id: 15127 reply_id: 315127[/import]

That’s going to be a bit hard to do in Corona SDK because we can’t easily manipulate bitmaps.

You could load in 15 copies of the same image and have 15 different masks (for each empty position – basically makes the masked area transparent.) and then work out the movement that way. It would be ugly but could be done.

[import]uid: 19626 topic_id: 15127 reply_id: 55961[/import]

You could try splitting the image into a spritesheet and then display only certain frames. [import]uid: 5833 topic_id: 15127 reply_id: 55964[/import]

@GrhamRanson, I don’t think he can do that with photos from the photo library on the fly.
[import]uid: 19626 topic_id: 15127 reply_id: 55969[/import]

Ah dang, my bad. I assumed you could import them into your app. Without being able to do that this would indeed be tricky. [import]uid: 5833 topic_id: 15127 reply_id: 55971[/import]