Hi, I would like to know how can I insert an image in my app tha
appear when I launch it and then dissappear few seconds later,
bringing the users to the main menu.
Thanks!
Thank you so much!
If your using the storyboard system to change between windows/scenes in your app you could put something like this in your main.lua
1 2 3 4 5 6 7 8 9 10 11 | local storyboard = require "storyboard" local compImage = display.newImage("compImage.png", true) compImage.x = display.contentWidth/2 compImage.x = display.contentHeight/2 local function loadGame() storyboard.gotoScene( "menu" ) end transition.to(compImage, {time=5000, alpha = 0, onComplete = loadGame }) |
This will display your image for 5 seconds and fade it out then load menu.lua
If your not using the storyboard, you can still use this code but need to change whats inside the loadGame function to whatever you use to switch to your menu.
EDIT: didn't see Danny's post until I submitted mine lol, his is much easier.
Thanks, the image appear, but the app change scene immediatly. do you know how can I fix it?
Using the @ertzel`s sample code will get the "time" you want to see it.
You mean Default.png?
Include this with your project. And it will be the first image shown on launching your app.
Failing that, create a scene for your company, and have it set to change to the menu screen after a delay
using
timer.performWithDelay()