Attract-Mode Support Forum
Attract-Mode Support => Scripting => Topic started by: ShinobiZ on November 17, 2016, 05:17:50 AM
-
Hello,
Anyone can provide me a sample code to display an image or a message like "Loading, please wait..." on the screen when you launch a game from "Grid" layout ?
Some time when you press the launch key, the emulator takes several seconds before popup on the screen, this is why a waiting message would be nice instead a frozen layout :)
Another question but off topic, somebody kown if there is a script for MAME to exit that emulator if no input occured after X seconds ?
Thanks in advance,
-
Anyone can provide me a sample code to display an image or a message like "Loading, please wait..." on the screen when you launch a game from "Grid" layout ?
Some time when you press the launch key, the emulator takes several seconds before popup on the screen, this is why a waiting message would be nice instead a frozen layout :)
Rocket Launcher?
http://forum.attractmode.org/index.php?topic=858.0
-
Below is code fragment of my layout that does the 'displaying a picture when lanching game'
It may need some modifying though..
The key is displaying such image at 'case Transition.ToGame' and hide at other cases.
I used alpha properties for fade in/out effects. It might be easier to use 'IsVisible'.
Anyway, the code fragment is as follows:
local screen_now_loading = fe.add_image("Loading.png", (fe.layout.width - 600)/2, (fe.layout.height - 300)/2, 0, 0);
fe.add_transition_callback( "launch_transition" );
function launch_transition( ttype, var, ttime ) {
switch ( ttype )
{
case Transition.StartLayout:
screen_now_loading.alpha = 0;
break;
case Transition.FromGame:
if ( ttime < 255 )
{
foreach (o in fe.obj)
o.alpha = ttime;
screen_now_loading.alpha = 0;
return true;
}
else
{
foreach (o in fe.obj)
o.alpha = 255;
screen_now_loading.alpha = 0;
}
break;
case Transition.EndLayout:
if ( ttime < 255 )
{
foreach (o in fe.obj)
o.alpha = 255 - ttime;
screen_now_loading.alpha = 0;
return true;
}
break;
case Transition.ToGame:
if ( ttime < 255 )
{
foreach (o in fe.obj)
o.alpha = 255 - ttime;
screen_now_loading.alpha = ttime;
return true;
}
screen_now_loading.alpha = 255;
break;
}
return false;
}
-
thanks this is great thank you for sharing this code. you are very generous !
-
thanks a lot !
Thierry
-
thanks this is great thank you for sharing this code. you are very generous !
Is there a way to add animed gifs ? Sequence of figures ?
-
I want to display an image on the desktop and have the window of the emulator positioned over top of the image, and then when the emulator is closed I want the image to close too....
This is implemented with retroarch, but I want for use with winuae loader.
Ideas?