Smooth Event Fade In

● ARCHIVED · READ-ONLY
Started by Danelius90 7 posts View original ↗
  1. I'm new to scripting in MV and have been googling how to do this but couldn't find what I wanted.

    I want an event to fade in smoothly, so I've made a loop that sets the event's opacity gradually increasing it. However the screen isn't updated until the script has finished. Is there some call to update what is displayed during a script? I'd prefer not to use a plugin as it seems like it should be simple enough and I'll probably just use it once anyway.
  2. This is probably not the most efficient solution but I came up with this a while back - in a parallel event run this
    Spoiler
    upload_2018-3-10_15-50-13.png
    and it will handle the updating on its own. Works fine for an occasional effect. Thread can be closed
  3. Jonforum said:
    i recommended you to use the ivra libs for this
    https://forums.rpgmakerweb.com/index.php?threads/iavra-animate-everything-easing-library.46826/

    PHP:
    let myEvent = $gameMap.event(1);
    new IAVRA.ANIMATE.Tween(myEvent, {_opacity: 0}).duration(60).start(); //for rmmv sprite
    new IAVRA.ANIMATE.Tween(myEvent, {alpha: 0}).duration(60).start(); //for pixi sprite
    But is it better in performance?Or the same thing?(Because here, the performance of his code is fine)

    @topic: Your code works, but you need to add 1 thing on it: a wait (Or reduce that opacity increase to 1/frame) after that code, so it will fade in a bit slower(because that code of yours, the way it is now, takes less than 1 second to finish getting to 255, as it increases 5 per frame and MV runs at 60 frames/second)
  4. elpeleq42 said:
    But is it better in performance?Or the same thing?(Because here, the performance of his code is fine)

    @topic: Your code works, but you need to add 1 thing on it: a wait (Or reduce that opacity increase to 1/frame) after that code, so it will fade in a bit slower(because that code of yours, the way it is now, takes less than 1 second to finish getting to 255, as it increases 5 per frame and MV runs at 60 frames/second)

    yes is very more fast to use pure scrypt than a script call inside a rmmv event.
    try performance.now()
    rmmv use eval() each time you call script in string.

    bench here
    https://jsperf.com/function-vs-constructor-vs-eval
  5. But is faster always lighter?(Thats really a question, I don't know)
    Because those tests you posted shows that this method is a lot faster, but to the game's "ecosystem" is it lighter?
  6. Jonforum said:
    i recommended you to use the ivra libs for this
    https://forums.rpgmakerweb.com/index.php?threads/iavra-animate-everything-easing-library.46826/
    Thanks for suggesting this, this might come in handy in future


    elpeleq42 said:
    @topic: Your code works, but you need to add 1 thing on it: a wait (Or reduce that opacity increase to 1/frame) after that code, so it will fade in a bit slower(because that code of yours, the way it is now, takes less than 1 second to finish getting to 255, as it increases 5 per frame and MV runs at 60 frames/second)
    Thanks I'll have a play around. At the moment it's comparable to using FadeIn Screen for a similar effect