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

gionni44

  • Newbie
  • *
  • Posts: 6
    • 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

  • Newbie
  • *
  • Posts: 6
    • 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

  • Newbie
  • *
  • Posts: 6
    • 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: 16
    • 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

  • Newbie
  • *
  • Posts: 6
    • 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: 391
  • 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

  • Newbie
  • *
  • Posts: 6
    • 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 »