Author Topic: How to insert Emulator text story  (Read 512 times)

gionni44

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
How to insert Emulator text story
« on: February 14, 2018, 03:05:28 AM »
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

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: How to insert Emulator text story
« Reply #1 on: February 14, 2018, 05:34:25 AM »
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

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: How to insert Emulator text story
« Reply #2 on: February 14, 2018, 09:55:08 AM »
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

  • Jr. Member
  • **
  • Posts: 17
    • View Profile
Re: How to insert Emulator text story
« Reply #3 on: February 14, 2018, 02:03:52 PM »
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

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: How to insert Emulator text story
« Reply #4 on: February 14, 2018, 11:44:22 PM »
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");


jedione

  • Sr. Member
  • ****
  • Posts: 418
  • punktoe
    • View Profile
Re: How to insert Emulator text story
« Reply #5 on: February 15, 2018, 07:14:43 AM »
iv been looking for somthing like this to...
im trying your code and it is not working for me

any idea what im doing wrong...here
Code: [Select]
local emu_text = fe.add_text( "", 100, 100, 200, 200 );
emu_text.set_rgb( 255, 0, 0 );
emu_text.font="comic";
emu_text.align = Align.Left;
emu_text.charsize = 24;

function transition_callback2( ttype, var, ttime ) {
   switch ( ttype ) {
      case Transition.ToNewList:
         switch ( fe.list.name )   {
            case "shmups":
               emu_text.msg = "this is a test";
               break;
            case "arcadesd":
               emu_text.msg = "hellow";
               break;
         }
         break;
   }
}
fe.add_transition_callback("transition_callback2");
help a friend....

gionni44

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: How to insert Emulator text story
« Reply #6 on: February 15, 2018, 08:32:02 AM »
shmups? what is it?

every "case" should match emulator or display name, shouldn't you?
« Last Edit: February 15, 2018, 08:37:29 AM by gionni44 »

qqplayer

  • Sr. Member
  • ****
  • Posts: 206
    • View Profile
Re: How to insert Emulator text story
« Reply #7 on: March 07, 2018, 11:48:10 AM »
The most simple way is create a folder inside "romlists" called "consoles" , "arcades" , "handhelds"...
This only works if you have a romlist called consoles.txt , arcades.txt... and the platforms plugin enabled.
Then just create a .cfg file with the text you want to show in a layout with "overview" the file must be named like the system you have included on the romlist.
For example:

Consoles.txt

Code: [Select]
#Name;Title;Emulator;CloneOf;Year;Manufacturer;Category;Players;Rotation;Control;Status;DisplayCount;DisplayType;AltRomname;AltTitle;Extra;Buttons
Atari 2600;Atari 2600;@;;;;;;;;;0;;;;;
NES;NES;@;;;;;;;;;0;;;;;

NES.cfg

Code: [Select]
overview The Nintendo Entertainment System (commonly abbreviated as NES) is an 8-bit home video game console that was developed and manufactured by Nintendo. It was initially released in Japan as the Family Computer on July 15, 1983, and was later released in North America during 1985, in Europe during 1986 and 1987, and Australia in 1987. The best-selling gaming console of its time, the NES helped revitalize the US video game industry following the video game crash of 1983.

Always add "overview " at the beginning.


wrybread

  • Full Member
  • ***
  • Posts: 51
    • View Profile
Re: How to insert Emulator text story
« Reply #8 on: March 14, 2018, 01:07:39 PM »
Where are you getting your text stories from? Is there some archive of them out there?

gionni44

  • Jr. Member
  • **
  • Posts: 16
    • View Profile
Re: How to insert Emulator text story
« Reply #9 on: March 15, 2018, 01:00:10 AM »
I scape with emulationstation and put it in romlist/extra
There's also a method with attract mode to import with command line
It's a good idea to create a tread where share romlists!