Skip to main content

IceOver

Based on game build 714014 | Last updated: 2026-03-08

Overview

IceOver is a UI widget that displays a dynamic freeze overlay (alpha-faded fullscreen image) on the player's screen when their temperature falls into freezing ranges. It reacts to temperature changes via an event listener on the owner entity and adjusts visual intensity and freeze-related sound playback across four temperature thresholds. It uses the temperature component on the owner to determine the current temperature, with a fallback to player class data or default tuning values.

Usage example

local owner = ThePlayer
owner:Installwidget("iceover", IceOver(owner))
-- The widget automatically activates upon listening to 'temperaturedelta' events on the owner.
-- No additional manual initialization is required after construction.

Dependencies & tags

Components used: temperature (via GetCurrent())
Tags: None identified.

Properties

PropertyTypeDefault ValueDescription
ownerEntity instancenilThe entity whose temperature triggers the overlay.
imgImage widgetnilThe fullscreen image child used for the freeze visual.
laststepnumber0Current freeze stage index (0–4).
alpha_minnumber1Current minimum alpha value of the overlay.
alpha_min_targetnumber1Target minimum alpha value for smooth interpolation.

Main functions

OnIceChange()

  • Description: Responds to temperature changes by evaluating current temperature against freeze thresholds, advancing or retreating the freeze stage (laststep), updating alpha_min_target, and optionally playing a freeze sound. If the stage increases, it starts continuous update; if fully thawed, it hides the overlay.
  • Parameters: None.
  • Returns: Nothing.
  • Error states: None.

OnUpdate(dt)

  • Description: Smoothly interpolates alpha_min toward alpha_min_target using linear interpolation (lerp). Updates the image's alpha range accordingly, shows/hides the widget based on alpha_min, and manages update cycle via StartUpdating/StopUpdating.
  • Parameters: dt (number) — delta time in seconds since last frame.
  • Returns: Nothing.

Events & listeners

  • Listens to: temperaturedelta — fired on the owner entity when temperature changes; triggers OnIceChange().
  • Pushes: None.