Utility component that connects to world dimension changes. More...
| Import Statement: | import Clayground.Behavior |
WorldChangedConnections monitors a ClayWorld2d for changes to its coordinate system and dimensions. When any world property changes (pixelPerUnit, bounds), it calls the provided callback function.
This is useful for components that need to recalculate positions or dimensions when the world configuration changes.
Example usage:
import Clayground.Behavior Item { WorldChangedConnections { world: theWorld callback: function() { // Recalculate positions when world changes updateEntityPositions() } } }
callback : var |
Function to call when world properties change (required).
The callback is invoked when pixelPerUnit or world bounds (xWuMin, xWuMax, yWuMin, yWuMax) change.
world : ClayWorld2d |
The world to monitor for changes (required).