← Back to Docs
  • index.html
  • Clayground
  • Clayground.Behavior
  • WorldChangedConnections
  • Clayground 2025.2
  • WorldChangedConnections QML Type

    Utility component that connects to world dimension changes. More...

    Import Statement: import Clayground.Behavior

    Properties

    Detailed Description

    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()
            }
        }
    }

    Property Documentation

    callback : var [required]

    Function to call when world properties change (required).

    The callback is invoked when pixelPerUnit or world bounds (xWuMin, xWuMax, yWuMin, yWuMax) change.


    world : ClayWorld2d [required]

    The world to monitor for changes (required).