It looks like you're new here. If you want to get involved, click one of these buttons!
function playSound (target, event) if target:hitTestPoint(event.x, event.y) then local mySound = Sound.new("pop.wav") local uiSfxChannel = mySound:play() uiSfxChannel:setPitch(math.random()) uiSfxChannel:setVolume(.7) end end local playBtn = Bitmap.new(Texture.new("btn.png")) playBtn:setPosition(40, 40) stage:addChild(playBtn) playBtn:addEventListener(Event.MOUSE_DOWN, playSound, playBtn)
iPhone SE 2016 12.1 - does not work (Safari, Chrome)
I have to test and investigate a little bit to see if I find the difference.
SinisterSoft: “ I don't create classes that much - classes are good for making things simpler but imho for frame rate they are also death by a thousand cuts.”
Totebo: “ Best quote ever.”