Attract-Mode Support > Scripting
How to insert Emulator text story
gionni44:
Hi guys, I would put a text story about each system inside my layout.
I thinked to read text from a .txt named with Emulator (es. sega32x.txt, genesis.txt etc...) but I'm not able
or
another way that I thinked is to write each system/story inside layout.nut and when variable match Emulator
AM show its system story
I know the method by creating a jpg with all text and use it like an image art but is too long when I have to change text
Thanks guys!
gionni44:
I found this solution that it takes text from romlist voices (Players, Emulator, etc...)
this is close to what I want, but is not available for systems or displays.
What's the way to show a string matched to display or emulator in use?
local emu_text = fe.add_text ( "", flx*0.01, fly*0.01, flw*0.30, flh*0.03 );
emu_text.set_rgb( 255, 255, 255 );
emu_text.font="RobotoMono-Medium";
emu_text.align = Align.Left;
fe.add_transition_callback("selection_transition");
function selection_transition( ttype, var, ttime ) {
if ( ttype == Transition.ToNewSelection) {
local emu_name = fe.game_info(Info.Emulator);
emu_text.msg = emu_name;
}
return false;
}
Thanks!
gionni44:
I'm trying this one but doesn't work, could someone help me?
The goal is to show text when each display start
local emu_text = fe.add_text( "", flx*0.01, fly*0.01, flw*0.30, flh*0.03 );
emu_text.set_rgb( 255, 255, 255 );
emu_text.font="RobotoMono-Medium";
emu_text.align = Align.Left;
function transition_callback( ttype, var, ttime )
{
switch ( ttype )
{
case Transition.ToNewSelection:
local selected = fe.game_info(Info.Emulator, var);
switch ( selected )
{
case "sega32x":
emu_text.msg = "bla bla bla bla bla bla bla e futiti!";
break;
case "nes":
emu_text.msg = "bla bla bla bla bla bla bla e futiti!";
break;
}
break;
}
}
fe.add_transition_callback("transition_callback");
rand0m:
Try adding [emulatorname].cfg in romlists\[Displaymenu] - should work if you are utilizing platforms addon. In the cfg add overview before adding the console/system story. You can access that in your layout by calling [overview]. Example:
local sysview = fe.add_text("[Overview]", 1000, 500, 600, 300);//overview of system with dimensions
sysview.font="BebasNeue Book.ttf";//font utilized
sysview.align = Align.Left;//alignment of text
sysview.word_wrap = true;//wrap or not
sysview.charsize = 24;//charachter-size of text
sysview.style = Style.Bold;//style borld, normal or italic
sysview.set_rgb(255,255,255);//text color
gionni44:
Thank you rand0m but I found another solution that works!
local emu_text = fe.add_text( "", flx*0.01, fly*0.05, flw*1.00, flh*0.03 );
emu_text.set_rgb( 255, 255, 255 );
emu_text.font="RobotoMono-Medium";
emu_text.align = Align.Left;
function transition_callback2( ttype, var, ttime ) {
switch ( ttype ) {
case Transition.ToNewList:
switch ( fe.list.name ) {
case "sega32x":
emu_text.msg = "ce l'ho fatta cazzo!";
break;
case "mastersystem":
emu_text.msg = "sistema 2";
break;
}
break;
}
}
fe.add_transition_callback("transition_callback2");
Navigation
[0] Message Index
[#] Next page
Go to full version