How to fade in/out when loading autosaves ?

  • #1, by nelsoncSaturday, 21. February 2015, 04:46 9 years ago
    When loading an autosave, the engine directly shows the scene. I would like to set a fade transition instead, is it possible ?

    Newbie

    43 Posts


  • #2, by afrlmeSaturday, 21. February 2015, 11:00 9 years ago
    Try this...

    1. inside of your playable scenes create an at begin of scene action (if you don't already have one).

    2. add an execute a script action part containing (see code block below) to the very top of the at begin of scene actions action part list...
    game.CurrentScene.SceneBrightness = 0
    game.CurrentScene:to(500, {SceneBrightness = 100}, easeQuintInOut)
    


    It should set the scenes brightness to 0 (which will be full black) on scene load & then should fade back to 100% over 500ms.

    P.S: I can't guarantee it will work in the current public build, but it will work in the next public build. I don't know when the next build will be out though. If it doesn't work, it might work if you link directly to the scene itself rather than trying to access it via game.CurrentScene.

    -- replace scene name with the name of the scene (name is case sensitive)
    Scenes["scene_name"].SceneBrightness = 0
    Scenes["scene_name"]:to(500, {SceneBrightness = 100}, easeQuintInOut)
    

    Imperator

    7278 Posts

  • #3, by nelsoncSaturday, 21. February 2015, 16:33 9 years ago
    Second version works, thank you !

    Newbie

    43 Posts

  • #4, by afrlmeSaturday, 21. February 2015, 16:59 9 years ago
    No problem. smile

    The first version works in the build I'm using, but I know that the shorthand Lua is not 100% working in the current public build; especially in regards to path finding where global tables such as game are involved.

    Imperator

    7278 Posts