lua - Display an image & hide it according to a variable -


I would like to display an image in a particular area, according to one variable. For example, when a user clicks on the avatar, it shows a specific image. Once she clicks on another incarnation, the second image will appear.

I tried to remove the previous image, and tried to show a new one, but she said "Trying to call Reliezelf () with zero value".

Define in the table:

  local item_bigsize = {}  

So I tried it:

  items [i] = display.newImageRect ("item /" .. item ['pos' .. i ..'_name'] .. ".png", 80, 80) item [i] .x = Holder_2 [i]. X + 10 items [i]. Element = 0 item [i] .y = holder [i] .i item group: insert (item [i]) item [i] .destination = i item [i]: addEventListener ("touch", onswchpress)  

And the function on SWitchPress works like this:

  on the function of the wordpress (event) i = event.target.destination if (event.phase == "starts "), Then title_item.text =" "for desc_item.text =" "n = 1,3 if n ~ = i then item_bigsize [n]: removeSelf () end n = n + 1 end elseif (event.phase = = "End") then item_bigsize [i] = display.newImageRect ("item /". Item ['pos' .. i ..'_name'] .. ".png", 240, 240) Item_bigsize [i] .x = 950 item_guides [i]. Fact = 0 item_books [i] .y = display.contentCenterY-130 Group: Insert (item_biosize [i]) title_item.text = item ['pos' .. i. . '_ Title'] desc_item.text = item ['pos' .. i ..'_ description'] and end  

Comments

Popular posts from this blog

winforms - C# Form - Property Change -

java - Algorithm negotiation fail SSH in Jenkins -

java - Messages from .properties file do not display UTF-8 characters -