SiliconGhetto Engine API
    Preparing search index...

    Function createSkyAPI

    • Returns {
          getTime(): number;
          setTime(t: number): void;
          setDayLength(s: number): void;
          isNight(): boolean;
          isDay(): boolean;
          isDusk(): boolean;
      }

      • getTime: function
        • Get the current time of day as a fraction (0.0 = midnight, 0.5 = noon, 1.0 = next midnight).

          Returns number

          Time of day (0.0 - 1.0)

      • setTime: function
        • Set the time of day.

          Parameters

          • t: number

            Time as a fraction (0.0 = midnight, 0.25 = dawn, 0.5 = noon, 0.75 = dusk)

          Returns void

      • setDayLength: function
        • Set how many real-world seconds make up one full in-game day.

          Parameters

          • s: number

            Day length in seconds (default 180)

          Returns void

      • isNight: function
        • Check whether it is currently nighttime.

          Returns boolean

          True if nighttime

      • isDay: function
        • Check whether it is currently daytime.

          Returns boolean

          True if daytime

      • isDusk: function
        • Check whether it is currently dawn or dusk (transitional light).

          Returns boolean

          True if in a transitional period