newtableview + mask causing images to not be visible since build .860

I took a break from my app and took a vacation. When I left I was still happily using daily build .860. Since that time a new stable release came out and now there are more daily builds for the new iOS 6 and iPhone 5.

So I updated to the latest daily build (.921) and found my background row images in my working tableview to no longer be visible. I loaded .860 back up and it all worked as expected. After loading countless versions I ironically found build .861 is where it all broke down. I see there were a few bug fixes in .861 for tableviews and scrollviews. After some fiddling around and reading the updated API docs and the forums, I found nothing that would cause this wierd behavior. The only thing I have come to figure out is if I remove the mask from my tableview all the images display correctly.

Anyone experiencing any issues with masks on tableviews? I am finding it unlikely that we have went from .861 to .921 without an issue like this coming up and being fixed, especially with a new public release in the middle of that timeframe.

Another odd thing is if I bring the problem image to the front with toFront(), it becomes visible. However if I bring the text in the row toFront() as well, the background row image becomes invisible yet again.

I trimmed my code down to simply adding a small png file and inserting it into the rowgroup. If no mask, it shows up. If there is a mask, it doesn’t show up. Everything points to the mask not playing well with other images. Inserting just a line of text works fine.

The mask fits the requirements:
white
4 pixel black border larger than the tableview size
24 bit PNG
height and width a multiple of 4

If anyone has any ideas what the issue could be, please share. [import]uid: 56820 topic_id: 31263 reply_id: 331263[/import]

Hmmm. I just played around with background images for the first time tonight and I’m using a build from about a week ago (not at my office so I can’t check) – the bg images seem to be showing fine for me. Yes, I’m using a mask on the tableView.

Is it possible that inserting them into the row view in a different order might do something? Just guessing…

Jay [import]uid: 9440 topic_id: 31263 reply_id: 125026[/import]

Okay, back in the office I see I’m using v906 of Corona Simulator

You can see in this partial screenshot the row background is showing up okay – and I am using a mask.

The mask I’m using is just a simple square: http://gamedevnation.com/images/mask.png

Jay
[import]uid: 9440 topic_id: 31263 reply_id: 125058[/import]

Thanks for sharing Jay. I have tried changing the order and even just loading one image, nothing else. Still the same.

I finally decided to just create a new test project to narrow down the issue. I created a very basic main.lua and the same issue occurs. I am hoping I am just doing something stupid in my code rather than it being a bug. Please take a look at this code and see what you think.

widget = require "widget"  
  
function onRowTouch(event)  
end  
  
function onRowRender(event)  
 local row = event.target  
 local rowGroup = event.view  
 background = display.newImage("explosion\_blue.png",true)  
-- background = display.newText("Test",0,0,native.systemFontBold,14)  
 rowGroup:insert(background)  
end  
  
GameTable = widget.newTableView({maskFile="menumask.png",top=264, left=0, height=550,width=630,bgColor={255,255,255,0},hideBackground=false,noLines=true})  
  
GameTable:insertRow{  
 id=1,  
 onEvent=onRowTouch,  
 onRender=onRowRender,  
 height=112,  
 rowColor={0,0,0,0},  
 lineColor={0,0,0,0}  
 }  

As you can see, I also have a newtext line commented out. If I switch from loading the image to creating the text, it all works fine. Its visible and masked. It’s only images that cause the issue for me. [import]uid: 56820 topic_id: 31263 reply_id: 125064[/import]

I got your code to work after tweaking it a bit – I changed the size of the tableView widget to fit an iPhone screen, which I don’t think has anything to do with the problem.

It was after I specifically set the position of the background image that it started working. Before then I think the background image was there, but somewhere out of site.

Hang on…

I can make it work or not work simply by removing the rowColor parameter in the insertRow call. With that in there the background image doesn’t show, but when I take it out it’s there.

Check that and see if it’s the same on your end…

Jay
[import]uid: 9440 topic_id: 31263 reply_id: 125074[/import]

Ah nice catch. I guess I needed to take it down to an even more basic setup. I didn’t go far enough.

Definitely a bug. If you leave rowColor in but change it’s alpha, the image is there but is covered by the rowColor object. Setting it to 100 you can see the image behind the transparent rowColor object, that or the object is simply taking on the alpha of the rowColor. Either way I guess I will let Corona Labs figure that part out. Think it’s time to post a bug report.

Thanks for helping me narrow this down Jay! [import]uid: 56820 topic_id: 31263 reply_id: 125076[/import]

Actually when writing up the bug report I realized it’s not one or the other as I suggested above. It has to be inheriting the alpha of the rowColor setting. If the rowColor object was covering the image then the alpha setting of 255 would hide the image, not the way it is now, instead hiding it at 0 alpha.

Bug submitted! [import]uid: 56820 topic_id: 31263 reply_id: 125077[/import]

Cool, I’ve been digging into tableView a lot the last week, so it’s nice to know where another problem is so it doesn’t rise up and smite me. :slight_smile:

Jay [import]uid: 9440 topic_id: 31263 reply_id: 125078[/import]

Hmmm. I just played around with background images for the first time tonight and I’m using a build from about a week ago (not at my office so I can’t check) – the bg images seem to be showing fine for me. Yes, I’m using a mask on the tableView.

Is it possible that inserting them into the row view in a different order might do something? Just guessing…

Jay [import]uid: 9440 topic_id: 31263 reply_id: 125026[/import]

Okay, back in the office I see I’m using v906 of Corona Simulator

You can see in this partial screenshot the row background is showing up okay – and I am using a mask.

The mask I’m using is just a simple square: http://gamedevnation.com/images/mask.png

Jay
[import]uid: 9440 topic_id: 31263 reply_id: 125058[/import]

Thanks for sharing Jay. I have tried changing the order and even just loading one image, nothing else. Still the same.

I finally decided to just create a new test project to narrow down the issue. I created a very basic main.lua and the same issue occurs. I am hoping I am just doing something stupid in my code rather than it being a bug. Please take a look at this code and see what you think.

widget = require "widget"  
  
function onRowTouch(event)  
end  
  
function onRowRender(event)  
 local row = event.target  
 local rowGroup = event.view  
 background = display.newImage("explosion\_blue.png",true)  
-- background = display.newText("Test",0,0,native.systemFontBold,14)  
 rowGroup:insert(background)  
end  
  
GameTable = widget.newTableView({maskFile="menumask.png",top=264, left=0, height=550,width=630,bgColor={255,255,255,0},hideBackground=false,noLines=true})  
  
GameTable:insertRow{  
 id=1,  
 onEvent=onRowTouch,  
 onRender=onRowRender,  
 height=112,  
 rowColor={0,0,0,0},  
 lineColor={0,0,0,0}  
 }  

As you can see, I also have a newtext line commented out. If I switch from loading the image to creating the text, it all works fine. Its visible and masked. It’s only images that cause the issue for me. [import]uid: 56820 topic_id: 31263 reply_id: 125064[/import]

I got your code to work after tweaking it a bit – I changed the size of the tableView widget to fit an iPhone screen, which I don’t think has anything to do with the problem.

It was after I specifically set the position of the background image that it started working. Before then I think the background image was there, but somewhere out of site.

Hang on…

I can make it work or not work simply by removing the rowColor parameter in the insertRow call. With that in there the background image doesn’t show, but when I take it out it’s there.

Check that and see if it’s the same on your end…

Jay
[import]uid: 9440 topic_id: 31263 reply_id: 125074[/import]

Ah nice catch. I guess I needed to take it down to an even more basic setup. I didn’t go far enough.

Definitely a bug. If you leave rowColor in but change it’s alpha, the image is there but is covered by the rowColor object. Setting it to 100 you can see the image behind the transparent rowColor object, that or the object is simply taking on the alpha of the rowColor. Either way I guess I will let Corona Labs figure that part out. Think it’s time to post a bug report.

Thanks for helping me narrow this down Jay! [import]uid: 56820 topic_id: 31263 reply_id: 125076[/import]

Actually when writing up the bug report I realized it’s not one or the other as I suggested above. It has to be inheriting the alpha of the rowColor setting. If the rowColor object was covering the image then the alpha setting of 255 would hide the image, not the way it is now, instead hiding it at 0 alpha.

Bug submitted! [import]uid: 56820 topic_id: 31263 reply_id: 125077[/import]

Cool, I’ve been digging into tableView a lot the last week, so it’s nice to know where another problem is so it doesn’t rise up and smite me. :slight_smile:

Jay [import]uid: 9440 topic_id: 31263 reply_id: 125078[/import]