mercredi 17 juin 2015

Corona sdk 2 random text

I`m have problem from this is make would tap my button view local b and local a but that not overlap code:

function randomText(event)

display.remove(mmDis)

local a = {"Cristiano ronaldo jest najlepszy!","messi jest dobry!","lewandowski jest ok","diego lopez to 
bramkarz realu"}

local b = {"blue","red","pink","orange"}

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=175
    mmDis:setFillColor(0, 0, 0, 1)  




Aucun commentaire:

Enregistrer un commentaire