Snapshot object doesn't change color

I have a text and a Rectangle inside a snapshot, also a rectangle that has a touch listener

whenever I touch the rectangle, supposed to be the Rectangle in the snapshot will change color.

but nothing happens. I checked it already using print and the touch responds well, the color doesn’t change, please help

Code :

 function onObjectTouchTab(self,event) if event.phase == "began" then print(self.name) if self.name == "payment" then print("AGAGAGA") rectPayment:setFillColor(0.043, 0.360, 0.043) rectHotline:setFillColor(0.5, 0.5, 0.5) rectKalakbay:setFillColor(0.5, 0.5, 0.5) elseif self.name == "kalakbay" then rectKalakbay:setFillColor(0.043, 0.360, 0.043) rectHotline:setFillColor(0.5, 0.5, 0.5) rectPayment:setFillColor(0.5, 0.5, 0.5) elseif self.name == "hotline" then rectHotline:setFillColor(0.043, 0.360, 0.043) rectKalakbay:setFillColor(0.5, 0.5, 0.5) rectPayment:setFillColor(0.5, 0.5, 0.5) end elseif event.phase == "moved" then elseif event.phase == "ended" or "cancelled" then end return true end

Hi @james8858,

Snapshots (of several items) are slightly different than normal display groups of items, in that they don’t automatically re-render when a child’s property changes. So, you have to “invalidate” the snapshot to instruct it to re-render on the next pass.

Please see this guide on the topic:

http://docs.coronalabs.com/daily/guide/graphics/snapshot.html

Best regards,

Brent

Hi @james8858,

Snapshots (of several items) are slightly different than normal display groups of items, in that they don’t automatically re-render when a child’s property changes. So, you have to “invalidate” the snapshot to instruct it to re-render on the next pass.

Please see this guide on the topic:

http://docs.coronalabs.com/daily/guide/graphics/snapshot.html

Best regards,

Brent