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