I’m praying that I’ve made a dumb mistake here and that someone can hit me aside the head and remind me about my occasional stupidity, but I’m completely stumped as to why this code doesn’t work. I’ve even tried to delay the loading of the saved file, but had no success. So, any help is much appreciated.
local img = display.newText("TEST",0,0,native.systemFontBold,50) -- create text object local w=img.width; local h=img.height -- save the object's width and height display.save(img,{filename="text.png"}) -- this saves the file properly - verified display.remove(img);img=nil -- remove the original object local obj=display.newImageRect("text.png",w,h) -- why is this object nil? print(tostring(obj)) -- this line prints "nil"