Once again I am coming cap in hand for some advice, I am trying to get a splash screen working, but it is animated. Can somebody please look at this and give me some guidance please please please???
local movieclip = require("movieclip")
-- Main function - MUST return a display.newGroup()
function new()
local localGroup = display.newGroup()
local theTimer
local myAnim
local showLoadingScreen = function()
myAnim = movieclip.newAnim{ "001.png", "002.png","003.png","004.png","005.png","006.png","007.png","008.png","009.png","010.png",}
myAnim.x = 0
myAnim.y = 0
myAnim:play()
localGroup:insert(myAnim)
local goToLevel = function()
director:changeScene( "menu" )
end
theTimer = timer.performWithDelay( 5000, goToLevel, 1 )
end
showLoadingScreen()
unloadMe = function()
end
-- MUST return a display.newGroup()
return localGroup
end
thank you so much, I am not been lazy but can not understand why it does not work
Chris [import]uid: 7388 topic_id: 5612 reply_id: 305612[/import]
What do you mean “it does not work”?
Do you mean you can’t see your animation?
It’s practically invisible at 0,0.
Do you mean nothing happens?
Where is this code in the scheme of things? Who is calling new()?
The more information you give in your post, the more likely you are to get a (relevant) response. [import]uid: 12635 topic_id: 5612 reply_id: 19125[/import]
But now I am doubting it, I am not at my computer at the moment so can not check, can I call new() in the main file or is it easier to call new() in this file???
Many thanks
Chris [import]uid: 7388 topic_id: 5612 reply_id: 19525[/import]
So I have been working with lua for about a month now and thought I had it cracked, now I am doubting it.
The problem I have is the code works when I just use an newImage, but as soon as I try with an animation it breaks.
I have posted my main.lua and loadmenu.lua here please help
local physics = require("physics")
physics.start()
physics.setGravity(0,0.08)
local director = require("director")
local mainGroup = display.newGroup()
local function main()
mainGroup:insert(director.directorView)
director:changeScene("loadmenu")
return true
end
main()
module(..., package.seeall)
local movieclip = require("movieclip")
function new()
local localGroup = display.newGroup()
local theTimer
local myAnim
local showLoadingScreen = function()
myAnim = movieclip.newAnim{ "001.png", "002.png","003.png","004.png","005.png","006.png","007.png","008.png","009.png","010.png",}
myAnim.x = 80
myAnim.y = 260
myAnim:play()
localGroup:insert(myAnim)
local goToLevel = function()
director:changeScene( "menu" )
end
theTimer = timer.performWithDelay( 5000, goToLevel, 1 )
end
showLoadingScreen()
unloadMe = function()
if theTimer then timer.cancel( theTimer ); end
if myAnim then
myAnim:removeSelf()
myAnim = nil
end
end
-- MUST return a display.newGroup()
return localGroup
end
Thanks Chris [import]uid: 7388 topic_id: 5612 reply_id: 19690[/import]