tableView blocking tint feature?

Going crazy with this one because it just doesn’t seem to work unless it’s outside of the tableView. (But I’ve tried other test code where tinting within the tableView works perfectly.) Any ideas would be appreciated.

[code]function u.headerBackButton()
local group = display.newGroup()

– Create the back button rectangle
group.back = display.newRect(group, 0, 0, 56, 48)
group.back.gradient = graphics.newGradient( {70,70,70}, {100,100,100}, “down”)
group.back.touchGradient = graphics.newGradient( {20,20,20}, {50,50,50}, “down”)
group.back:setFillColor(group.back.gradient)
group.back:setReferencePoint(display.CenterReferencePoint)
group.mask = graphics.newMask(“masks/mask-backbutton.png”)
group.back:setMask(group.mask)

– Create the back button icon
group.icon = display.newImageRect(group, “assets/logo.png”, 32, 32)
group.icon:setReferencePoint(display.CenterReferencePoint)
group.icon.x = group.back.x - 5
group.icon.y = group.back.y

– FUNCTION: touch listener
function group:touch(event)

if event.phase == “began” then

– Set appearance and focus
self.back:setFillColor(self.back.touchGradient)
self.icon:setFillColor(0,255,0)
display.getCurrentStage():setFocus(self)

elseif event.phase == “ended” then

– Revert appearance and focus
self.back:setFillColor(self.back.gradient)
self.icon:setFillColor(255)
display.getCurrentStage():setFocus(nil)

end
return true
end --/group:touch(event)
group:addEventListener(“touch”)

return group
end[/code]

Note that the gradient tinting works just fine. It’s only the icon :setFillColor() that is failing. And there’s no error either - it just acts as if I never wrote “self.icon:setFillColor(0,255,0)”. [import]uid: 41884 topic_id: 33678 reply_id: 333678[/import]

I have a feeling it’s because you are using a mask on the group. I’m fairly sure that setFillColor() doesn’t work on objects with a mask (and if a group has a mask then it will not work on any object in that group).

As you say, it just ignores the setFillColor command, no error message is sent. [import]uid: 84115 topic_id: 33678 reply_id: 133894[/import]

Understood, Alan, but in this case:

  1. only a sub-object (group.back) has a mask, not the displayGroup. group.icon is only connected by way that they both have the same displayGroup parent.

  2. If you take this out of widget.newTableView() it seems to work as intended

…which is why I’m so puzzled. ?_? [import]uid: 41884 topic_id: 33678 reply_id: 133900[/import]

Does your tableView itself use a mask? [import]uid: 56820 topic_id: 33678 reply_id: 133921[/import]

anderoth: Good point. It does. I suppose that renders the tint half useless in tableViews since a mask is almost mandatory, but I guess I’ll have to switch to sprite frames.

Still puzzled why the rectangles support it though… [import]uid: 41884 topic_id: 33678 reply_id: 133934[/import]

It sounds like it may be a bug related to masks.

I can not use alpha settings on any images inside a tableview with a mask at the moment. I bugged my problem and was told it was a bug with masks, not tableviews.

Your tableview mask is not directly applied to your icon so I would lean towards this being another bug with masks or a huge limitation.

I really hope they look into fixing masks soon. [import]uid: 56820 topic_id: 33678 reply_id: 133940[/import]

Anderoth is correct.

This is a mask related side effect. [import]uid: 84637 topic_id: 33678 reply_id: 134016[/import]

Danny: gotcha. Is it something to file against or just request a note in the docs for? [import]uid: 41884 topic_id: 33678 reply_id: 134065[/import]

It’s a known bug so we have it on file.

If it isn’t mentioned in the docs please by all means file a “hate it” or “love it but” on the relevant docs page.

Thanks! [import]uid: 84637 topic_id: 33678 reply_id: 134066[/import]

I have a feeling it’s because you are using a mask on the group. I’m fairly sure that setFillColor() doesn’t work on objects with a mask (and if a group has a mask then it will not work on any object in that group).

As you say, it just ignores the setFillColor command, no error message is sent. [import]uid: 84115 topic_id: 33678 reply_id: 133894[/import]

Understood, Alan, but in this case:

  1. only a sub-object (group.back) has a mask, not the displayGroup. group.icon is only connected by way that they both have the same displayGroup parent.

  2. If you take this out of widget.newTableView() it seems to work as intended

…which is why I’m so puzzled. ?_? [import]uid: 41884 topic_id: 33678 reply_id: 133900[/import]

Does your tableView itself use a mask? [import]uid: 56820 topic_id: 33678 reply_id: 133921[/import]

anderoth: Good point. It does. I suppose that renders the tint half useless in tableViews since a mask is almost mandatory, but I guess I’ll have to switch to sprite frames.

Still puzzled why the rectangles support it though… [import]uid: 41884 topic_id: 33678 reply_id: 133934[/import]

It sounds like it may be a bug related to masks.

I can not use alpha settings on any images inside a tableview with a mask at the moment. I bugged my problem and was told it was a bug with masks, not tableviews.

Your tableview mask is not directly applied to your icon so I would lean towards this being another bug with masks or a huge limitation.

I really hope they look into fixing masks soon. [import]uid: 56820 topic_id: 33678 reply_id: 133940[/import]

Anderoth is correct.

This is a mask related side effect. [import]uid: 84637 topic_id: 33678 reply_id: 134016[/import]

Danny: gotcha. Is it something to file against or just request a note in the docs for? [import]uid: 41884 topic_id: 33678 reply_id: 134065[/import]

It’s a known bug so we have it on file.

If it isn’t mentioned in the docs please by all means file a “hate it” or “love it but” on the relevant docs page.

Thanks! [import]uid: 84637 topic_id: 33678 reply_id: 134066[/import]

Oh! I think Corona must solve this issue. I think most of us need to tint objects even using mask. [import]uid: 44013 topic_id: 33678 reply_id: 144309[/import]

Oh! I think Corona must solve this issue. I think most of us need to tint objects even using mask. [import]uid: 44013 topic_id: 33678 reply_id: 144309[/import]

Oh! I think Corona must solve this issue. I think most of us need to tint objects even using mask. [import]uid: 44013 topic_id: 33678 reply_id: 144309[/import]