Constructor
new Light()
Creates an instance of Light.
Properties:
Name | Type | Description |
---|---|---|
transform |
LightTransformProps | |
castShadow |
boolean | |
shading |
boolean | |
centerReflection |
boolean | |
flattenShadow |
boolean | |
fading |
boolean | |
flags |
number | |
type |
number | Type of the Light |
shadowLength |
number | Length of shadow |
maxShadowStep |
number | The maximum step of shadow caster per pixel - Default value is 128 |
specularStrength |
number | Strength of specular light |
precision |
number | Shadow precision - Default value is 1 |
angle |
number | Rotation of the light |
spotAngle |
number | Angle of the light source - Default value is 180deg [hemisphere] - 360deg [sphere] |
attenuation |
number | Light attenuation -- Default value is 1 - The attenuation is calculated by the following formula: -- pow(distance, attenuation) |
- Source:
Extends
Classes
Members
callbackAfterRender :function
Set/Get after render callback - It will be called after the Item rendered
Type:
- function
- Overrides:
- Source:
callbackBeforeRender :function
Set/Get before render callback - It will be called before the Item rendered
Type:
- function
- Overrides:
- Source:
castShadow :boolean
Set/Get shadow casting
Type:
- boolean
- Source:
centerReflection :boolean
Set/Get is the reflection moves towards the center of the screen
Type:
- boolean
- Source:
fading :boolean
Set/Get fading the light
Type:
- boolean
- Source:
flattenShadow :boolean
Set/Get flatten the shadow - Cast shadow if true and a pixel is higher or equal than the light z position - Cast shadow if false and a pixel is higher than the light z position
Type:
- boolean
- Source:
parent :Container
Set/Get parent
Type:
- Overrides:
- Source:
shading :boolean
Set/Get shading
Type:
- boolean
- Source:
(readonly) stage :StageContainer
Get StageContainer
Type:
- Overrides:
- Source:
(static) RENDERING_TYPE
Type "light"
- Source:
(static) Type
Light type
Properties:
Name | Type | Description |
---|---|---|
POINT |
number | Like a lamp light source |
DIRECTIONAL |
number | Like sunlight |
- Source:
Methods
callEventHandler(event)
Handle event - It can handle mouse events if the item is interactive and has [ onPointerOver, onPointerOut, onPointerMove, onPointerDown, onPointerUp, onPointerClick ] function
Parameters:
Name | Type | Description |
---|---|---|
event |
* |
- Overrides:
- Source:
destruct()
Destruct class
- Overrides:
- Source:
getBounds() → {Rectangle}
Returns with bounds
- Overrides:
- Source:
Returns:
- Type
- Rectangle
getCorners() → {Array.<Point>}
Returns with the calculated corder positions
- Overrides:
- Source:
Returns:
- Type
- Array.<Point>
remove()
Remove Item from parent
- Overrides:
- Source:
update()
Update color and transform values
- Overrides:
- Source: