https://marketplace.yoyogames.com/ass...
You can use the functions in this project in your game in order to achieve a real-time time of day
system in the vein of games like Animal Crossing, Pokemon, and Cozy Grove.
The two things that you will need is the Animation Curve, ac_timeOfDay, and the function, TimeOfDay,
which is found in the script file, scr_timeOfDay.
ac_timeOfDay contains curves that tell the system the position of the sun at sunset and sunrise throughout
the course of a year. This allows the sun to be out for longer in the Summer than it is in the Winter.
These curves are able to be customized to your liking.
timeOfDay takes a datetime as an input, and outputs an array of useful values that can be used in a
variety of ways such as controlling the ambient light colour and blending multiple sky textures or surfaces.
The array that timeOfDay returns is [ sunsetFade, nightFade, starsFade, ambientColourD, ambientColourL, dayPercentage ].
Here is a guide to what these functions do and how to use them:
sunsetFade: a value from 0 to 1 that can be used to blend from midday to sunrise or sunset
nightFade: a value from 0 to 1 that can be used to blend from sunset to midnight, or midnight to sunrise
starsFade: a value from 0 to 1 that can be used to add stars at night
ambientColourD: ambient skylight colour, darker variant
ambientColourL: ambient skylight colour, lighter variant
dayPercentage: a value from 0 to 1 ranging from midnight to midnight
By purchasing this resource, you are entitled to use it as you'd like for personal and commercial
purposes. No credit is needed, but is always appreciated.