Screen Fade package

Name: Screen Fade
By AdamO on Discord

How to use:

  • Install Screen Fade from the Community Tab
  • Add the ScreenFade script folder template to your User template
  • To use, call “DoScreenFade()” on the User entity from any script
  • You must pass the first parameter, FadeTime, which is how long the fade in AND fade out take. I.e. if you pass 1, it will take 1 second to fade in, 1 second to fade out
  • You can optionally then pass a HoldTime parameter, which means it will hold at full opacity for that time before fading out (default is 0)
  • You can optionally then pass a Color parameter, which will display the fade in that color. The default is whatever the “defaultColor” property is set to, which is white as standard

Hey Adam – just tried using this and it works great. Adds a nice level of polish and helped me hide the janky couple of seconds when I teleport the player across the map.

One thing that caught me up though: I’m defining the fade color dynamically based on a variable in my game and I wasn’t sure how to format the color. I initially defined the color like Color.New(255, 81, 17) but it looks like your script converts color percentages to those 0-255 numbers. This comment will probably be enough for anyone facing the same issue, I solved it by simply removing the " * 255 " for each color in the GetColorString function at the bottom of the screenFadeScript. Hopefully this helps if anyone else gets stuck trying to do something similar. :slight_smile:

Yeah I think my script is set up to convert color properties, which come in the format (0-1, 0-1, 0-1) rather than (0-255, 0-255, 0-255). I’ll look at updating the package to check if the numbers are floats or ints and adjust the maths accordingly

It is now updated and GetColorString should be able to take colors in either format :slight_smile:

1 Like