Answer the question
In order to leave comments, you need to log in
Why doesn't text change in Corona SDK?
I analyzed an example from the official Corona documentation (working with text). Wrote like this:
local weightGroup = display.newGroup()
local myWeight = display.newText(weightGroup, "MyText", display.contentCenterX, -7, 'SuezOne', 42):setFillColor(186/255, 98/255, 98/255)
myWeight.text = "Kek"
08:57:31.409 \main.lua:3: attempt to index local 'myWeight' (a nil value)
08:57:31.409 stack traceback:
08:57:31.409 \main.lua:3: in main chunk
Answer the question
In order to leave comments, you need to log in
setFillColor() does not return an object. Divide into two lines - creating an object and applying color. Then it will work.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question