Author Topic: fe.gameinfo  (Read 7585 times)

slydog43

  • Full Member
  • ***
  • Posts: 66
    • View Profile
fe.gameinfo
« on: August 27, 2015, 01:02:46 PM »
Not sure what I'm doing wrong, but I can't get updated return values when using fe.gameinfo.  when doing this the value returned does NOT change even though it should when I can selection (its a different emulator)

local emu = fe.add_text( fe.game_info(Info.Emulator), flx*0.01, fly*0.01, flw*0.3, flh*0.03 );


any ideas.  Im trying to display a different image depending on the emulator that the selected game runs under.   Thanks

slydog43

  • Full Member
  • ***
  • Posts: 66
    • View Profile
Re: fe.gameinfo
« Reply #1 on: August 27, 2015, 02:24:33 PM »
I have figured out a few things since last post.  I found out that you can only use fe.gameinfo in transistions and ticks.  I have this which does not work either.  any ideas on how to do this.

fe.add_transition_callback( "selection_transition" );

function selection_transition( ttype, var, ttime ) {
   if ( ttype == Transition.ToNewSelection) {
      local emu = fe.add_text( "Emulator: ", flx*0.01, fly*0.01, flw*0.3, flh*0.03 );
   }
return false;
}

it just adds a few points on the screen, very strange.

liquid8d

  • Global Moderator
  • Sr. Member
  • *****
  • Posts: 442
    • View Profile
Re: fe.gameinfo
« Reply #2 on: August 27, 2015, 06:07:03 PM »
don't add text in your transition callback - it will try to add a new text object each time it is called. Add the text object once, then in your transition callback, update the text msg property. Something more like this:

Code: [Select]
local emu_text = fe.add_text("", flx*0.01, fly*0.01, flw*0.3, flh*0.03 );
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 = "Emulator: " + emu_name;
   }
   return false;
}

You may need to update it at other transition times as well...

slydog43

  • Full Member
  • ***
  • Posts: 66
    • View Profile
Re: fe.gameinfo
« Reply #3 on: August 28, 2015, 04:55:12 AM »
Works great, Thanks, your awesome!!!

Now how can I change a system logo, can't seem to find a way to change an image.  i'm trying stuff like

local emu_text = fe.add_text( "Emulator: ", flx*0.01, fly*0.01, flw*0.3, flh*0.03 );
local emu_logo = fe.add_image( "mame.png", 0, 0, 400, 200);

function selection_transition( ttype, var, ttime )
{
   if ( ttype == Transition.ToNewSelection) {
      local emu_name = fe.game_info(Info.Emulator);
      emu_text.msg = "Emulator: " + emu_name;
      emu_logo.name = "daphne.png";   
   }
   return false;
}

fe.add_transition_callback("selection_transition");


text changes perfectly, but the image does not change.  Any ideas on this one??  (maybe since its adding a static image it can't change, any other ways to do this?)

Edit:  got it by using emu_logo.file_name,    THANKS FOR YOUR HELP!!!
« Last Edit: August 28, 2015, 05:09:04 AM by slydog43 »