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]