split an image to a grid of 10x10 frames

I like to split an image (picture) in a grid of 10x10 frames to handle each frame individual. Did anyone have I idea or better a sample code how to realize it with corona?

Thanks a lot
Michael
[import]uid: 96270 topic_id: 37333 reply_id: 67333[/import]

Hello,
This would be a picture you get “outside the app” or something, thus you can’t separate the pieces in your graphics program?

You could try masking, but it would require 100 different masks (or maybe less with some clever mask rotation), and 100 masked objects (same picture masked 100 times). Not sure how this would do performance-wise…

Brent [import]uid: 200026 topic_id: 37333 reply_id: 145626[/import]

Of course can I split the picture in my graphics program and store the frames in an imagesheet and load it, but this means I have to this picture by picture. I would be easier to load a picture as display object and split it to the frames and handle each frame as a display object. Possible or not with corona?
Michael [import]uid: 96270 topic_id: 37333 reply_id: 145635[/import]

Hi Michael,
It’s not possible to split the image apart “in code” as you describe. The only approach would be the masking as I describe, but that’s certainly not ideal.

Not sure if it would work within your design, but you could create both the pieces and the entire image in your graphics program, then in the app, when a piece is “pulled off” or moved, you swap that appropriate piece in there and also drop a background-matching square (or a mask) over the location it was in, to make it look like the piece was removed from the overall image. Of course, this might not be even close to what your design is about, but it’s just a general suggestion.

Brent [import]uid: 200026 topic_id: 37333 reply_id: 145650[/import]

Hello,
This would be a picture you get “outside the app” or something, thus you can’t separate the pieces in your graphics program?

You could try masking, but it would require 100 different masks (or maybe less with some clever mask rotation), and 100 masked objects (same picture masked 100 times). Not sure how this would do performance-wise…

Brent [import]uid: 200026 topic_id: 37333 reply_id: 145626[/import]

Of course can I split the picture in my graphics program and store the frames in an imagesheet and load it, but this means I have to this picture by picture. I would be easier to load a picture as display object and split it to the frames and handle each frame as a display object. Possible or not with corona?
Michael [import]uid: 96270 topic_id: 37333 reply_id: 145635[/import]

Hi Michael,
It’s not possible to split the image apart “in code” as you describe. The only approach would be the masking as I describe, but that’s certainly not ideal.

Not sure if it would work within your design, but you could create both the pieces and the entire image in your graphics program, then in the app, when a piece is “pulled off” or moved, you swap that appropriate piece in there and also drop a background-matching square (or a mask) over the location it was in, to make it look like the piece was removed from the overall image. Of course, this might not be even close to what your design is about, but it’s just a general suggestion.

Brent [import]uid: 200026 topic_id: 37333 reply_id: 145650[/import]

https://github.com/SimeonAronK/ImageSplit-Corona-Sdk

Where’s the problem to setup the image as an imageSheet and use display.newSprite for each segment?

https://github.com/SimeonAronK/ImageSplit-Corona-Sdk

Where’s the problem to setup the image as an imageSheet and use display.newSprite for each segment?