Looks like the x dimension of a mask must be a multiple of 4. So 300, 304, 308, etc works without skew. [import]uid: 27183 topic_id: 6168 reply_id: 30694[/import]
900*50 and 904*50 don’t work. [import]uid: 7356 topic_id: 6168 reply_id: 30705[/import]
What build are you using? I just tried 900x50 on 336 in the simulator and there’s no skewing. [import]uid: 27183 topic_id: 6168 reply_id: 30707[/import]
I am using 268 but I’ll try the latest night build too.
Thanks for your help! [import]uid: 7356 topic_id: 6168 reply_id: 30716[/import]
Np, just trying to help out where I can. Btw, I’m not seeing the issue in 268 either. I’ve uploaded my test project here for anyone to checkout http://www.loqheart.com/corona/masking.zip
@Magenda, Let me know how it works out for you. [import]uid: 27183 topic_id: 6168 reply_id: 30718[/import]
josh6, is correct. The object that is masked is skewed (leaning right at approx 45 degrees), and I’m not scaling the object. [import]uid: 27183 topic_id: 6168 reply_id: 27662[/import]
@Don
Your files helped me find out what happens. It’s not the size of the mask that needs to be some pixels greater than the original size… it is that the whole image must be included inside a zone of *black* pixels (4-5 is ok). In other words, the edges of the mask must be black.
The size of the mask is also significant.
Your project works fine in 268. I changed your 950 mask with mine (after embedding a black zone around the edges) and it works nice.
Thanks again!
@Ansca, there is still a BUG here…
[import]uid: 7356 topic_id: 6168 reply_id: 30726[/import]
> In other words, the edges of the mask must be black
Not necessarily. I have another mask elsewhere in my project that is completely white. It is the exact same size as the image it is masking. I modify its maskX position, and I get a poor man’s progress bar. The area outside the mask bounds is correctly hidden, but the mask itself has no black areas.
Once any amount of black area is introduced, though, I think you’re right. At that point, you’d better have a black border around the edges or things will get weird. [import]uid: 38950 topic_id: 6168 reply_id: 30728[/import]
Glad the files helped, and thanks for doing the extra research.
So you mean you replaced my 900x50 mask with your own of the same dimensions right? Cause a 950x50 skews for me, but 952x50 works.
_So to get masking working, make sure your masking image has a black pixel padding of at least 4 pixels all around, and make sure the x dimension is a multiple of 4.
If you don’t have enough padding you’ll get bleeding, and if you don’t have a multiple of 4 in the x dimension you get skewing._
@josh6, yeah if you have a mask that touches the borders you get bleeding, that would make for a cool progress bar. Check out this masking:
http://screencast.com/t/WpWGyso5d
One last note, the bleeding seems to occur only on the top and left sides. [import]uid: 27183 topic_id: 6168 reply_id: 30729[/import]
I found that the scaling of mask is not linear.
Moreover, adding an edge to a mask would cause a gradient on the filling of the mask when scaling, thus changing the alpha of parts of the mask.
– Advanced UI + Graph for Corona® | Website | Forum (https) | See: [import]uid: 11385 topic_id: 6168 reply_id: 31965[/import]
I’m hitting this same bug in build Version 2011.336 (2011.1.20)…any word from Ansca on it?? Has it been fixed in the new builds?? [import]uid: 6175 topic_id: 6168 reply_id: 34787[/import]
We have been doing some testing of bit masking and here is the list of current problems (as of build 539).
-
Bit mask width and height must be a multiple of 4 or the mask will be very skewed.
-
Bit mask must have at least a 3 pixel black border.
-
As of build 505, bit masks can be applied to text objects and display groups. When applying a bit mask to a display group, the mask is not centered on the group (it’s located at the TopLeft of the group). See object:setMask() API page for the workaround.
I’ve seen cases where the bit mask border must be larger than 3 pixels and I’m trying to track down those situation.
If you have other cases that cause problems, please file a bug report and include a short sample demonstrating the problem.
Thanks,
Tom [import]uid: 7559 topic_id: 6168 reply_id: 40713[/import]
Ok to understand bitmap mask-ing.
You have object.
You have bitmap mask.
You compare the two.
The results(of comparision) are what ? True, False ? How do I collect the results ?
Could someone post some really basic example code ?
could some shed some light to my understanding of CORONA’s bitmap masking ?
thanks [import]uid: 11094 topic_id: 6168 reply_id: 53928[/import]
There’s more details in the API description of graphics.newMask() plus there’s working examples in the sample code for Graphics/Flashlight and X-Ray. [import]uid: 39538 topic_id: 6168 reply_id: 54036[/import]