Attract-Mode Support > Scripting

[Solved] Add click sound "case Transition.ToNewSelection" gamelist

(1/1)

qqplayer:
I see some layouts with "click" sounds but only using wheel module.
I want to add a "click.mp3" sound when I select a new game but with for example the "Basic" layout.
Tried this example:


--- Code: ---function transition_callback(ttype, var, ttime)
{
    switch ( ttype )
    {
        //case Transition.StartLayout:
case Transition.ToNewSelection:
                 local Wheelclick = fe.add_sound("Click.mp3")
Wheelclick.playing=true
            break;
    }
    return false;
}
--- End code ---

http://forum.attractmode.org/index.php?topic=221.0


But doesnt work.

UPDATE: Solved found the solution on fry theme , thanks @jedione


--- Code: ---function fade_transitions( ttype, var, ttime ) {
 switch ( ttype ) {
  case Transition.ToNewSelection:
  case Transition.ToNewList:
local Wheelclick = fe.add_sound("Click.mp3")
      Wheelclick.playing=true
  break;
  }
 return false;
}

fe.add_transition_callback( "fade_transitions" );
--- End code ---

Navigation

[0] Message Index

Go to full version