Hovering problem
Posted: Mon May 25, 2015 7:34 pm
Hey guys, i have a problem with hovering.
This code should, when hovering the rectangles change the string 'terrainInfo', to formated one with details, and it does but only on the last one item from the table. Tested it with the print(terrain[1]), and it's returning the good value/id, working good in console. In my other code from another game it's working good, i have no idea what im i doing wrong. Can someone help me with this? Was searching on forum but didnt find an answer.
Sorry for my bad english
Code: Select all
if x >= terrain[i][4] and x <= terrain[i][4]+128 and y <= 620 then
--print("ID Terenu: ".. terrain[i][1])
terrainInfo = "ID: ".. terrain[i][1] .." | Owner: ".. terrain[i][5] .." | Gold per turn: " .. terrain[i][6] .. " | Weather: " .. terrain[i][7] .. " / " .. terrain[i][8]
else
terrainInfo = "Hover over the terrain to see info of it!"
end
Sorry for my bad english