T3:brightness
From IFWiki
brightness is a TADS 3 property that defines how much ambient light is in a room or how much light an object emits.
Overview
brightness should evaulate to one of the following numeric values:
- 0 = means no light.
By default, most Things do not emit light. A DarkRoom also has no light. - 1 = means self-illuminating light.
Authors should use this value for things that ought to be seen in dark rooms, but don't provide enough light to let the player see anything else. Examples of self-illuminating objects include luminous hands on a watch, LEDs on digital alarm clocks, the red light on a security camera, and laser beams. - 2 = means dim light.
Dim light is enough to let the player see where to go, but isn't enough to read by. By default, a Matchstick only gives off dim light when lit. - 3 = means medium light.
This is the normal light level. Medium light is considered good enough for most purposes, including reading. By default, most Rooms have medium light, and a Candle emits medium light. - 4 = means strong light.
This is stronger light than normal. Authors should use this value for things that can shine light into an adjacent room, like a searchlight.
Also:
- −1 = means invalid light level.
This value is reserved by the TADS 3 library to signal that brightness should be recalculated. An author should never need to set brightness to -1 in normal code.
The brightness property is documented for the Thing class; see thing.t.
In TADS 3, brightness levels can diminish when light passes through obscuring objects or over distance. For example, a player might be able to see the fire in a fireplace in the next room, but unable to read by its light at a distance. For an overview of how light is managed in TADS 3, see Light in TADS 3.
Summary
Classes where brightness is defined or modified:
- Thing.brightness = 0, since most objects do not emit light. See thing.t.
- LightSource.brightness is an anonymous function. It returns brightnessOn if the lightsource is lit, or brightnessOff if unlit. See objects.t.
- Room.brightness = 3, since most rooms are normally lit. See travel.t.
- DarkRoom.brightness = 0, since dark rooms should have no light of their own. See travel.t.
Related properties:
This article is a stub. You can help IFWiki by expanding it.
TODO: We don't have a standard way of documenting T3 properties yet, but at the very least there should be a list of which classes/objects explicitly define the property, and which classes/objects explicitly override the default handling that it inherits.
TODO: We don't have a standard way of documenting T3 properties yet, but at the very least there should be a list of which classes/objects explicitly define the property, and which classes/objects explicitly override the default handling that it inherits.