When I attempt to change the text of a newEmbossedText object, the last string that was assigned does not clear and the new value is superimposed over it, causing the display of the text to be unreadable.
I fixed it in one case by setting the object.text = “ “, first, And then assigning a new value.
Object.text = “not confused” and it worked.
For some reason, it is not working for me in a different case.
Here is how I have it set up.
local topMessage
local topMessageDisplay
topMessage is declared at the top of the Lua file and is later given a string value
topMessageDisplay is also declared at the top and will later be given the following.
topMessageDisplay = newEmbossedText(sceneGroup, topMessage, centerX, centerY, native.systemFont, 24)
Then, when I attempt to change topMessage,
topMessage = “confused”
And set
topMessageDisplay.text = topMessage
The last string value remains in addition to any subsequent values given to topMessage even when I assign topMessageDisplay.text = “ “
And then set,
topMessageDisplay.text = topMessage
Or even explicitly to,
TopMessageDisplay.text = “Help me!”
All previous strings assigned overlap one another and are unreadable.
I am utterly confused as I have a working case in one place, and then this mess!
I went through my code and compared the one case that works to the other case that does not, and unfortunately, I can’t see where one differs from the other.
Does anyone know what I may have done wrong?
I tried so many variations of fixes and I went in circles to no avail.
I can’t seem to clear the object.text
This has to be an easy fix.
I did it once before!
What am I missing?
Thanks in advance
Chris