Public Release 2076 - Masking no longer working on my tableviews

I took the plunge and updated to Graphics 2.0 and was working through all the changes needed and noticed the masks on my tableviews are no longer working. I couldn’t find any information on a change that would affect this.

Did I miss something?

Can anyone verify this is happening for them also?

just comment out the maskfile in your tableView definition. The G2 tableViews mask themselves. See if this works well. 

Under normal circumstances that would work but my tableview isn’t designed to be masked as a rectangle.

I’m in the same position, took me ages to try and justify the text as it was all offset. I have a rounded edge rectangle for my mask which no longer works?

Ahh I see. Makes absolute sense of course. Sorry I missed this possibility. Suggest you file a bug report then. Good luck.

Ok I just submitted the bug.

For those who are in the same situation as me. I found that if you apply the mask after creating the tableview it works around the problem, at least for me. Use graphics.newMask() to create it and :setMask() on the TableView.

I would suggest that you file a bug report on this.  It’s not really a bug, but it’s a use case that containers doesn’t solve, so we need this in the engineering tracking database.

Please post your bug-report back here.

Thanks

Rob

just comment out the maskfile in your tableView definition. The G2 tableViews mask themselves. See if this works well. 

Under normal circumstances that would work but my tableview isn’t designed to be masked as a rectangle.

I’m in the same position, took me ages to try and justify the text as it was all offset. I have a rounded edge rectangle for my mask which no longer works?

Ahh I see. Makes absolute sense of course. Sorry I missed this possibility. Suggest you file a bug report then. Good luck.

Ok I just submitted the bug.

For those who are in the same situation as me. I found that if you apply the mask after creating the tableview it works around the problem, at least for me. Use graphics.newMask() to create it and :setMask() on the TableView.

I would suggest that you file a bug report on this.  It’s not really a bug, but it’s a use case that containers doesn’t solve, so we need this in the engineering tracking database.

Please post your bug-report back here.

Thanks

Rob

Just want to say that I’ve received a reply from Engineering on this re: #29677

  1. This use case will not be covered; if users want to be able to choose between a container mask or bitmap mask, somebody should make a feature request for it. (Which makes sense, it’s not a bug but it is a functionality change vs. 1.0)

  2. Using the workaround (apply a mask manually) means hitting the 3-nest limit (tableView mask, text mask, bitmap mask) so keep in mind it prevents you from adding further container objects inside the view.

So this is technically a deprecated feature without any advance notice. 

Well, the feature still works; it’s just that it uses a container (rectangle) instead of a bitmap now. Which is clean. And you can use graphics.newMask() to still apply a bitmap. G1.0 users would of course have an issue because .mask is deprecated but it’s a small amount of code to fix that.

Where trouble would come is in the nesting; tableView>mask is two so you can only nest a widget inside of that if it uses one mask. ie: I think newButton is alright since it’s all slices - the 3rd would be text on the button. But the tableView wouldn’t be able to fit something using two elements.

I’m not sure which widgets use two masking elements (container+text) apart from scrollView/tableView, so I guess we would have to look through those for potential troublespots.

I’ve discovered this problem when I upgraded to the latest version of Corona today. Would someone please provide a code snippet to show how to use the graphics.newMask() to create it and :setMask() on the TableView?

This is for a custom shape mask.

Thanks!

It’s pretty simple.

  1. You need a mask image; everything in white is visible, everything in black is cut out. 

  2. Instantiate the mask.

[lua]local myMask = graphics.newMask(“themask.png”)[/lua]

  1. Provided your scrollView object exists, you can set the mask on it.

[lua]myScrollView:setMask(myMask)[/lua]

Thanks so much. I did get that to work, but now I have a new problem. My category background color and lines are not showing up. Did this change as well?

I see how the colors changed. This is going to be a major overhaul. Just when I thought I was done coding for a while. What a pain!!!