TableView Mask Issues

Hi All,

Just having an issue regarding my maskFile on my tableview widget, i’ve built my table and populated it with data, all this is fine and works exactly how I want it to, i’ve set the coordinates and width/height for it, and that is fine also, but when I create a mask for it, I get a white line along the diagonal (from top right to bottom left) cutting through the text. Also when I export to iphone, it crashes before that scene loads…

local widget = require "widget"  
   
 local top = 196;  
 local itemNames = {};  
 local nameData = {"Milk", "Bread", "Potatoes", "Apples", "Cats", "Marbles", "Rabbit", "Toothpaste"}  
 local itemList = nil;  
  
  
 local function setup()  
 itemList = widget.newTableView  
 {  
  
 top = 196,  
 height = 210,  
 left = 1,  
 width = 318,  
 maskFile = "image/Components/itemListMask.png"  
  
 }  
 end --setUp  
  
 local function loadData()  
 for x = 1, #nameData do   
 itemNames[x] = {}  
 itemNames[x].name = nameData[x];  
 itemNames[x].qty = 0;  
 itemNames[x].cost = math.random(1.00, 100.00);  
 itemNames[x].showDel = true;  
 end  
  
  
 end -- loadData  
  
 local function showRecords()  
  
 local function onRowRender(event)  
 local row = event.row;  
 local rowGroup = event.view;  
 local idx = row.index or 0;  
 local color = 0;  
  
 row.rowBG = display.newImageRect("image/Components/rowGraphic.png",   
 318, 32, false)  
 row.rowBG:setReferencePoint(display.TopLeftReferencePoint);  
 row.rowBG.y = 0;  
 row.rowBG.x = 0;  
  
 row.Name = display.newRetinaText(itemNames[idx].name, 0, 0, "Helvetica", 12);  
 row.Name:setTextColor(color);  
 row.Name:setReferencePoint(display.CenterLeftReferencePoint);  
 row.Name.x = 20;  
 row.Name.y = rowGroup.contentHeight \* 0.5;  
  
 row.Qty = display.newRetinaText(itemNames[idx].qty, 0, 0, "Helvetica", 12);  
 row.Qty:setTextColor(color);  
 row.Qty:setReferencePoint(display.CenterLeftReferencePoint);  
 row.Qty.x = 150;  
 row.Qty.y = rowGroup.contentHeight \* 0.5;  
  
 row.Cost = display.newRetinaText(itemNames[idx].cost, 0, 0, "Helvetica", 12);  
 row.Cost:setTextColor(color);  
 row.Cost:setReferencePoint(display.CenterLeftReferencePoint);  
 row.Cost.x = 220;  
 row.Cost.y = rowGroup.contentHeight \* 0.5;  
  
  
  
  
 rowGroup:insert(row.rowBG);  
 rowGroup:insert(row.Name);  
 rowGroup:insert(row.Qty);  
 rowGroup:insert(row.Cost);  
  
 end -- onRowRender  
  
 local function rowListener(event)  
  
 end -- rowListener  
  
 for x = 1, #itemNames do  
 itemList:insertRow  
 {  
 height = 32;  
 onRender = onRowRender,  
 listener = rowListener  
 }  
 end  
  
  
 end -- showRecords  

If anyone has encountered this issue or can see whats wrong, please let me know. My mask file is 322x214, simple white interior with 2 pixel black boarder as all the tutorials on this have suggested. Anyways, if anyone can work out why its doing this i’d be very appreciative.

Kind Regards,

Jessica Newton
Rose Covenant [import]uid: 168562 topic_id: 32417 reply_id: 332417[/import]

I believe the mask file dimensions need to be multiples of 4. So resize your mask to 324x216 and see if that fixes it. You can also try making the black border at least 3 pixels thick.

http://developer.coronalabs.com/reference/index/graphicsnewmask [import]uid: 9422 topic_id: 32417 reply_id: 128928[/import]

Hey Stephen,

That was spot on perfect, thank you! :slight_smile: Have to say, in all my searches for a solution I hadn’t stumbled across anything that was going to lead me to that solution on my own.

~ Jess
Rose Covenant [import]uid: 168562 topic_id: 32417 reply_id: 128929[/import]

Yeah, it doesn’t help that the official mask tutorial here
http://developer.coronalabs.com/reference/bitmap-masks-tableviews-and-scrollviews
gets it wrong! (x,y dimensions of the example aren’t both divisible by 4).
[import]uid: 9422 topic_id: 32417 reply_id: 128930[/import]

I believe the mask file dimensions need to be multiples of 4. So resize your mask to 324x216 and see if that fixes it. You can also try making the black border at least 3 pixels thick.

http://developer.coronalabs.com/reference/index/graphicsnewmask [import]uid: 9422 topic_id: 32417 reply_id: 128928[/import]

Hey Stephen,

That was spot on perfect, thank you! :slight_smile: Have to say, in all my searches for a solution I hadn’t stumbled across anything that was going to lead me to that solution on my own.

~ Jess
Rose Covenant [import]uid: 168562 topic_id: 32417 reply_id: 128929[/import]

Yeah, it doesn’t help that the official mask tutorial here
http://developer.coronalabs.com/reference/bitmap-masks-tableviews-and-scrollviews
gets it wrong! (x,y dimensions of the example aren’t both divisible by 4).
[import]uid: 9422 topic_id: 32417 reply_id: 128930[/import]