How to display a particoular text

Hello guys…

I ve read all the docs in the blog but I can’t find a solution

I ve 3 variables:

local A = 1 local B = 2 local C = 4

when someone click on the screen the fucntion should make a summation of these 3 variables and then display a text with the result… in this case 7…

How can I create a text that change everytime that someone change a variable??

With the print command The result can be seen only in the terminal but I wanna a text in the screen with the result…

I hope I ve been clear… Sorry for my bad english…

Thanks in advance

local A = 1 local B = 2 local C = 4 local textObject = display.newText("0", 200, 200, native.systemFont, 30) local function UpdateText() local result = A + B + C textObject.text = tostring(result) end Runtime:addEventListener("tap", UpdateText)
local A = 1 local B = 2 local C = 4 local textObject = display.newText("0", 200, 200, native.systemFont, 30) local function UpdateText() local result = A + B + C textObject.text = tostring(result) end Runtime:addEventListener("tap", UpdateText)