[SOLVED] Move image instead of Mask

How to move the image instead of it’s mask?

In the xRay example, I can only move the mask but not the image.

I even tried to put a button, if button was clicked, image.x = image.x + 10
this still move the mask + 10 but now image.

I read about this:
http://developer.coronalabs.com/forum/2011/05/17/mask-transition

But I can not insert the mask to a group, which will cause error.

One more thing, can we add 2 masks on the same image?

Thanks [import]uid: 81853 topic_id: 30980 reply_id: 330980[/import]

I don’t know what effect you realy need but try this:
[lua]image.y = image.y + 50
image.maskY = image.maskY - 50
[/lua]
It works with transition.to
[lua]
transition.to(image, {time=500, y = 50, maskY = -50, delta = true})
[/lua] [import]uid: 138389 topic_id: 30980 reply_id: 123936[/import]

@vovasoft
Thanks, it works.

What I need is simply “dig” three holes on an image in the front layer, so user can watch other images on the back layer through those holes.

This will be down simply by edit the front image in the image editor, but the problems is I have to use image from iPhone’s photo library or from camera.

I need at least three holes and user can drag those holes to where ever they need to be.
Looks like Mask is not the way to do this, for a start, it can only have one hole per image.

Thanks vovasoft.
I will mark this as SOLVED as we do have an answer for the topic.
[import]uid: 81853 topic_id: 30980 reply_id: 123983[/import]

Maybe someone have some ideas.
I know maybe how it will work with 2 holes.
first hole will be the mask over the the image.
for the second hole you can get a black .png image with a transparent hole in it and put it over your user image.
Maybe you can do it also for the third but I don’t know if it will give you the effect you want.
What do you think.? [import]uid: 138389 topic_id: 30980 reply_id: 123989[/import]

I don’t know what effect you realy need but try this:
[lua]image.y = image.y + 50
image.maskY = image.maskY - 50
[/lua]
It works with transition.to
[lua]
transition.to(image, {time=500, y = 50, maskY = -50, delta = true})
[/lua] [import]uid: 138389 topic_id: 30980 reply_id: 123936[/import]

@vovasoft
Thanks, it works.

What I need is simply “dig” three holes on an image in the front layer, so user can watch other images on the back layer through those holes.

This will be down simply by edit the front image in the image editor, but the problems is I have to use image from iPhone’s photo library or from camera.

I need at least three holes and user can drag those holes to where ever they need to be.
Looks like Mask is not the way to do this, for a start, it can only have one hole per image.

Thanks vovasoft.
I will mark this as SOLVED as we do have an answer for the topic.
[import]uid: 81853 topic_id: 30980 reply_id: 123983[/import]

Maybe someone have some ideas.
I know maybe how it will work with 2 holes.
first hole will be the mask over the the image.
for the second hole you can get a black .png image with a transparent hole in it and put it over your user image.
Maybe you can do it also for the third but I don’t know if it will give you the effect you want.
What do you think.? [import]uid: 138389 topic_id: 30980 reply_id: 123989[/import]