I`m have a problem because when i touch my button sometimes not appear my text... (Sorry for my English!) Code:
function randomText(event) display.remove(mmDis) local a = {"Cristiano ronaldo jest najlepszy!","messi jest dobry!","lewandowski jest ok","diego lopez to bramkarz
realu"}
com = (a[math.random(1,#a)])
local mmDis = display.newText(tostring(com),
display.contentWidth*0.57, display.contentHeight*0.7,
display.contentWidth*0.9, display.contentHeight*0.8, "Impact", 30)
mmDis.y=20
mmDis.x=190
mmDis:setFillColor(0, 0, 0, 1)
mmDis.anchorY = 0
end
play:addEventListener ("tap", randomText )
end
end play:addEventListener( "touch", object )
Aucun commentaire:
Enregistrer un commentaire