It looks like you're new here. If you want to get involved, click one of these buttons!
local function onTouch(self,event) print(self.col) end local token_orange_list = {}; for i=1,7 do token_orange_list[i] = Bitmap.new(Texture.new("image.png")); print(token_orange) token_orange_list[i]:setAnchorPoint(0.5, 0.5) token_orange_list[i]:setPosition(startX +(i-1)*delta ,startY); token_orange_list[i]:setScale(0.8,0.8) token_orange_list[i].col = i; token_orange_list[i]:addEventListener(Event.MOUSE_DOWN, onTouch,token_orange_list[i]) firstRowLayer_Orange:addChild(token_orange_list[i]) end |
Comments
have you tried Event:stopPropagation()?
You can check the "Drag Me" example to see it in action.
Likes: atilim
Just change onTouch to:
Thanks for your comment :P
(If you want to display your code, you can use < pre lang="lua" > Your code </ pre>)
Likes: vitalitymobile