Please login or register.

Login with username, password and session length
Advanced search  

News:

Forum rules - please read before posting, it can save you a lot of time.

Author Topic: Scene's methods overriding and question about Fade out.  (Read 2546 times)

0 Members and 1 Guest are viewing this topic.

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Scene's methods overriding and question about Fade out.
« on: December 22, 2009, 01:34:53 PM »

Hi,

1)  Is it possible to override Scene's object methods?

I'd like to do:
Code: [Select]
method ScrollTo(object){
var mainObject = Game.MainObject;
Game.MainObject = null;
this.ScrollTo(object);
Game.MainObject = mainObject;
}


2) When my actor leaves scene I just fade in screen. It's no problem.
However, when I am setting new scene I place actor on right place, turn him and so on. However, I need to fade out screen as long as I am setting scene. Because in some scenes (maybe if they load so quickly?) I see how actor is turning and so on.
I could set longer fade out time of course but I am hoping that better approach exists.

3) Is it possible to change default fade in/out time? I haven't found this option yet.


Thank you!
Logged

Mnemonic

  • WME developer
  • Administrator
  • Addicted to WME forum
  • *
  • Karma: 41
  • Offline Offline
  • Gender: Male
  • Posts: 5683
    • View Profile
    • Dead:Code Site
Re: Scene's methods overriding and question about Fade out.
« Reply #1 on: December 29, 2009, 09:36:14 AM »

1) You should be able to override any built-in method.
2) If you see the actor turning, perhaps you're using actor.TurnTo() method. If you want immediate direction change, use the actor.Direction property instead.
3) You can't change the duration of the default fading. You can however disable it (Game.ChangeScene("some.scene", false, false)) and use the Scene.FadeOut() / Scene.FadeIn() methods manually, which allows you to use any duration.
Logged
Yes, I do have a twitter account
Please don't send me technical questions in private messages, use the forum. ::wave

Mihulik

  • Occasional poster
  • **
  • Karma: 0
  • Offline Offline
  • Posts: 71
    • View Profile
Re: Scene's methods overriding and question about Fade out.
« Reply #2 on: December 29, 2009, 09:59:34 AM »

1)I didn't find AttachScript method in Scene object so I asked. However, I'll try it.
2)It's what I need!
3)I was afraid that it's the only one option. Never mind.

Thank you:-)
Logged
 

Page created in 0.022 seconds with 19 queries.