Please login or register.

Login with username, password and session length
Advanced search  

News:

IRC channel - server: waelisch.de  channel: #wme (read more)

Pages: 1 [2]  All

Author Topic: Question about Game.PlayMusic()  (Read 13811 times)

0 Members and 1 Guest are viewing this topic.

benkovici

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
    • View Profile
Re: Question about Game.PlayMusic()
« Reply #15 on: February 05, 2009, 07:17:10 PM »

If you want to add right click handler for an *inventory* item, look in the "items" folder. The "book" item in inventory is unrelated to the book in scene.

Thanks a lot Mnemonic it worked!

But returning to my question about PlayMusic(). I tried to do like you said, but I think something I did wrong cause on "Resume" button scene's music does't resume.
In the menu I added this lines:

Game.PlayMusicChannel(0,"music\Aguado.ogg");



//////////////////////////////
on "resume"
{
 Game.StopMusicChannel(0);
  Game.ResumeMusic("music\crypt.ogg");
  this.Close();
}
--------------------------
And in scene script I added:

Game.PlayMusic("music\crypt.ogg");


var VK_ESCAPE;
if(Keyboard.KeyCode==VK_ESCAPE)
{
 Game.StopMusic();
}
-------------
Help me please cause I'm totally confused.
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Question about Game.PlayMusic()
« Reply #16 on: February 05, 2009, 10:40:03 PM »

Firstly, what I said about StopMusic also applies to ResumeMusic. They don't expect any parameters, they work with the currently playing music (see the documentation for function parameters description).

Secondly, use other channel than 0 for your menu music. Channel 0 is what is used when you don't specify any channel.

Game.PlayMusic("music.ogg"); is equivalent to Game.PlayMusicChannel(0, "music.ogg");

Change PlayMusicChannel and StopMusicChannel for example to channel 1 and it should work.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

benkovici

  • Lurker
  • *
  • Karma: 0
  • Offline Offline
  • Posts: 23
    • View Profile
Re: Question about Game.PlayMusic()
« Reply #17 on: February 07, 2009, 12:47:27 PM »

Firstly, what I said about StopMusic also applies to ResumeMusic. They don't expect any parameters, they work with the currently playing music (see the documentation for function parameters description).

Secondly, use other channel than 0 for your menu music. Channel 0 is what is used when you don't specify any channel.

Game.PlayMusic("music.ogg"); is equivalent to Game.PlayMusicChannel(0, "music.ogg");

Change PlayMusicChannel and StopMusicChannel for example to channel 1 and it should work.

Thanks for your patience and help! I'll try to do like you said.
Logged
Pages: 1 [2]  All
 

Page created in 0.033 seconds with 19 queries.