Ok, i'am just one day working within Corona, but tried something, please adapt the code or make it better to help others and also me :)
If you could use it, be happy.
Cheers Freshworks
-------------------------------------------
-- Improvised loader example
-------------------------------------------
-- JUST SIMPLE LOADER EXAMPLE
txtloading = display.newText("LOADING",140,200)
txtloading:setTextColor(255,255,255)
local loader = display.newGroup()
-- UPDATE LOADER
local function updateLoader(perc)
local bar = display.newRect(120,240,perc,10)
bar:setFillColor(255,255,255)
loader:insert(bar)
end
-- LOAD CONTENT AND UPDATE THE LOADERBAR BY HAND
-- load file / content or whatever :)
updateLoader(10)
-- load file / content or whatever :)
updateLoader(20)
-- load file / content or whatever :)
updateLoader(30)
-- load file / content or whatever :)
updateLoader(40)
-- load file / content or whatever :)
updateLoader(50)
-- load file / content or whatever :)
updateLoader(60)
-- load file / content or whatever :)
updateLoader(70)
-- load file / content or whatever :)
updateLoader(80)
-- load file / content or whatever :)
updateLoader(90)
-- load file / content or whatever :)
updateLoader(100)
-- Release the loaderbars
for i=loader.numChildren,1,-1 do
local child = loader[i]
child.parent:remove( child )
end
txtloading:setTextColor(0,0,0) -- DO NOT NOW HOW TO RELEASE YET :)
--txtloading:remove <== won't work
-- MAINROUTINE
function main ( event )
-- worlds bestgamecode :)
txtloaded = display.newText("LOADING DONE..",115,200)
txtloaded:setTextColor(255,255,255)
end
-- START THE MAIN ROUTINE
Runtime:addEventListener("enterFrame",main)
Quote:
1 2 | txtloading:setTextColor(0,0,0) -- DO NOT NOW HOW TO RELEASE YET :) --txtloading:remove <== won't work |
Have you tried txtloading = nil? That would empty any value for txtloading.
Thanks happylewie, that will do the job.
Cheers
Thanks - I'll try it out!