Hi,
I am new to Lua, Can you tell me how can i use Event on mouse Click on particular images of buttons where it is added to a Container . Please Edit my following code and guide me.
function CommonAssets:addInventory(parent)
print("Adding the Inventory")
local group = Container.new()
self.inventoryJoinBtnDown = Bitmap.new(Texture.new("images/CommonAssets/JoinButtonDown.png", conf.textureFilter))
group:addChild(self.inventoryJoinBtnDown)
AssetsHelper:setPos(self.inventoryJoinBtnDown,130,120)
group:addEventListener("click", function()
sounds:play("button_click")
self:clickedInventoryButton()
end)
parent:addChild(group)
end
function CommonAssets:clickedInventoryButton()
print("Clicked")
end
No errors but event not triggering. Please help me.
Thanks
Dorado Lab
Comments
I do not know if I've understood the problem but I think this can help you
first you change:
[-] Liasoft
[-] Liasoft
[-] Liasoft