Skip to content

Class

DayNightCycleService

Generated GDScript class reference for CalendarTime.DayNightCycleService.

Status
Current
Version
v2.1.1
Source updated
2026-08-09
Generated on
2026-09-26

Derives time-of-day transitions from a clock and emits time_of_day_changed / day_night_transition_progress_changed on its bus. Instantiated by TimeHost per clock. Reads times_of_day from clock.calendar: the calendar is the schema and clocks inherit its times_of_day, so this service does not own a list.

Source: addons/calendar_time/day_night_cycle/service/day_night_cycle_service.gd

Syntax

class DayNightCycleService extends RefCounted

Members

NameKindSummary
DayNightCycleServiceLogicFieldCycle math for the day-night service.
ClockValidatorFieldValidates the bound clock.
clockPropertyClock whose date and time drive the day-night cycle. Set by the host.
time_of_dayPropertyCurrent time-of-day; `null` when unbound or the calendar has no TODs.
last_time_of_dayPropertyMost recently entered stage, used to detect transitions.
transition_progressPropertyProgress through the active time-of-day lighting transition.
resetMethod
get_previous_time_of_dayMethod
calculate_time_of_dayMethod
calculate_time_of_day_with_hours_timeMethod
get_last_enter_timeMethod
validateMethod