Extends
Classes
Members
(readonly) properties
The entity that this component is attached to.
- Inherited From
- Source
Methods
deserialize(props)
Populates the component properties from a data object. Override this method for custom property handling.
Parameters:
| Name | Type | Description |
|---|---|---|
props | object | The properties object (usually from JSON). |
- Inherited From
- Source
draw(ctx, viewWidth, viewHeight)
Draw the parallax layer.
Parameters:
| Name | Type | Description |
|---|---|---|
ctx | CanvasRenderingContext2D | |
viewWidth | number | Viewport width. |
viewHeight | number | Viewport height. |
- Source
updateOffset(cameraX, cameraY)
Update parallax offset based on camera position.
Parameters:
| Name | Type | Description |
|---|---|---|
cameraX | number | |
cameraY | number |
- Source