License from €75 Log in
DE EN FR ES IT CZ

Fade to Black function

This thread is a few years old. Some details may refer to an earlier version of Visionaire Studio. Current tutorials

  1. · 10 years ago
    Hey guys,
    I want to make a simple fade to black, including a small delay of 1 or 2 seconds.

    Originally I would use a "change scene" action part for that and show a black screen. But this is pretty complicated, especially if you have looping background sounds (that would just stop if you change the scene). 

    Could anybody help me with a simple "fade to black" function? I think there are many guys here who would need a function like that. smile

    Thanks in advance smile

    Marvel
  2. Working on a game?

    The free version covers up to 25 scenes per project. For more scenes and to sell your game, you need a license.

    See licenses Try it for free
  3. · 10 years ago
    with a little bit of Lua you could do the following inside an execute a script action part:

    game.CurrentScene:to(1500, {SceneBrightness = 0}) 

    its also possible to pass an easing effect as a third argument. 
  4. · 10 years ago
    Thats great. Thank you Sebastian. grin

    But one thing is weird: First, the room gets dark. After the room change, the next room (a close up) is not dark. And when I get back and leave the close up, the very next room is dark again... 

    Are menus and rooms show a different behavior here?
  5. · 10 years ago
    It's because the script Sebastian shared is adjusting the brightness for that particular scene only. Just add the same script inside of an at begin of scene action for that scene but set the delay to 0 & brightness to 100.
    game.CurrentScene:to(0, {SceneBrightness = 100})

  6. · 10 years ago
    ah yeah, sorry. So to make this complete:

    on scene enter action:

    game.CurrentScene:to(0, {SceneBrightness = 0})
    game.CurrentScene:to(1500, {SceneBrightness = 100})

    on scene leave action (actually i would do this before the leave action triggers)

    game.CurrentScene:to(1500, {SceneBrightness = 0})


  7. · 10 years ago
    Well, basically it works... but the brightness-fade doesn't have any effect on the particles. ^^ Any idea how to fix this?
  8. · 10 years ago
    Well, basically it works... but the brightness-fade doesn't have any effect on the particles. ^^ Any idea how to fix this?
    It's the scene brightness value. Guess you will probably have to adjust the actual game brightness instead, but I was having trouble with window brightness as it wasn't fading to 0 correctly when I tried to create a global brightness slide in an options menu scene.

  9. · 10 years ago
    The normal fade effect of VS is not working ? You can set the fade delay in the game options and thats what is used at scene switching, too i guess...

    (maybe its possible to edit the duration via lua)
  10. · 10 years ago
    Yeah according to data structure you can edit the global fade delay of the scene fade transition with...
    game.FadeDelay = 500

    As for what I was talking about in my last post, was this. For some reason when I tried using that in combination with a slider script I wrote it kept getting stuck at about 20% or something. Wouldn't let me slide it all the way to 0% which is strange as it was same script/functions I was using for the volume sliders which were working as they should.
  11. · 10 years ago
    Unfortunately I cannot use the general fade effect.

    Let me explain:
    I want to show a close up and need an inventory in that closeup. Therefore I also need a person on the screen (and a waysystem with a single way point). I solve this by changing the outfit to invisible and then change the screen.

    The problem now is, that there will be a short flickering of the persons sprite, when the outfit will be set to invisible. Thats why I fade to black BEFORE I change the outfit. 

    I solved this problem with your script. But as the fade doesn't affect the particles, I have a new problem now. ^^


  12. · 10 years ago
    Are the particles bound to an object?

    You could make an object with a screen filling black image in front of all objects which you could fade in by changing its visibility...

This thread is closed because nobody has replied for more than a year. Feel free to ask your question in a new thread.

New thread

Really delete this post?