Problem with adding mask to big image

I added a mask image to a huge image, like in the flashlight sample and it worked fine. But now I somehow have the problem the masked area is repeated to the left and right, means the circle masked area is not only shown once, but as an array of circles to the left and right side of the original.

Did someone else had this kind of problem and can help me solve it?

BTW: The flashlight sample is still working fine, so it isn’t a Corona problem! I just don’t know where to look at and hope someone else encountered this “array mask” problem before :slight_smile:

If you could post some code to evaluate it would help to determine the issue.

Thx. That’s a little difficult because I’m working with a lot of modules. But I can say it’s a mask I’m using on a group. In the group I then add a screen sized image. That is the only thing which is different from the sample project. I just thought maybe the problem here is known. If not I will take the time to create a sample to “extract” all the code to reproduce the issue.

There seems to be a connection between using composer scenes and the mask problem. Strange! When I’m starting my level the mask is used directly (the composer scene level from inside main.lua) the mask works fine. When I’m starting with another scene, like showing the game logo and mainmenu composer scenes first, then selecting the level… the mask problem is there in the level. I’m using composer.removeScene in the scenes… where else can be a problem?

I was able to circle the problem by calling different scenes first. After finding the scene which seemed to cause the problem I looked through the code and found this line:

display.setDefault( “textureWrapX”, “repeat” )

This was causing the problem two scenes “later” with the mask image because before leaving the first scene things had to be set back via:

display.setDefault( “textureWrapX”, “clampToEdge” )

  • Chris

If you could post some code to evaluate it would help to determine the issue.

Thx. That’s a little difficult because I’m working with a lot of modules. But I can say it’s a mask I’m using on a group. In the group I then add a screen sized image. That is the only thing which is different from the sample project. I just thought maybe the problem here is known. If not I will take the time to create a sample to “extract” all the code to reproduce the issue.

There seems to be a connection between using composer scenes and the mask problem. Strange! When I’m starting my level the mask is used directly (the composer scene level from inside main.lua) the mask works fine. When I’m starting with another scene, like showing the game logo and mainmenu composer scenes first, then selecting the level… the mask problem is there in the level. I’m using composer.removeScene in the scenes… where else can be a problem?

I was able to circle the problem by calling different scenes first. After finding the scene which seemed to cause the problem I looked through the code and found this line:

display.setDefault( “textureWrapX”, “repeat” )

This was causing the problem two scenes “later” with the mask image because before leaving the first scene things had to be set back via:

display.setDefault( “textureWrapX”, “clampToEdge” )

  • Chris