Hello,
I am new to lua language. I have recently created a game in lua. When I began with coding, I did not know the concept of composers and storyboards (my bad).
I read the tutorial of composer, and understood what it is and how it works. But, now i’m confused how to apply it to my code.
Please have a look at small piece of code below.
function welcomeScreen()
local img= display.newImage(“logopng.png”)
img.x=centerX
img.y=centerY
img:scale(1.7,1.7)
img.alpha=1
local text1 = display.newText("© 2014 ", 0, 0, “Helvetica”, 35)
text1.x=centerX
text1.y=centerY + 350
function remove_welcomeimg()
img:removeSelf()
text1:removeSelf()
text1=nil
img=nil
end
transition.fadeOut(text1, {time=1500, delay=2000, onComplete = remove_welcomeimg})
transition.fadeOut(img, {time=1500, delay=2000, onComplete=mainScreen,})
end
welcomeScreen() --This fubction is called initially to start the program (game)
The game begins with this welcome screen… firther followed by mainscreen(). Now how to sort this code to work with composer?
What exactly happens is :
Tap game icon --> welcome screen appears (this gets removed with transition) --> mainScreen() is called from where game starts.
Please provide me the following code with composer?This would help me apply composer to rest of my code and help me understanding composers more clearly.
(I have never used storyboards either)