pixi.js
    Preparing search index...

    Interface Observer<T>

    Observer used to listen for observable point changes. Provides callback mechanism for point value updates.

    // Basic observer implementation
    const observer: Observer<ObservablePoint> = {
    _onUpdate: (point) => {
    console.log(`Point updated to (${point.x}, ${point.y})`);
    }
    };

    // Create observable point with observer
    const point = new ObservablePoint(observer, 100, 100);

    // Observer will be notified on changes
    point.x = 200; // Logs: Point updated to (200, 100)
    • Used internally by ObservablePoint
    • Triggered on x/y changes
    • Can track multiple points
    • Useful for change detection
    interface Observer<T> {
        _onUpdate: (point?: T) => void;
    }

    Type Parameters

    • T

      The type of point being observed

    Index

    Properties

    Properties

    _onUpdate: (point?: T) => void

    Callback to call when the point has updated. Triggered whenever x or y coordinates change.

    Type declaration

      • (point?: T): void
      • Parameters

        • Optionalpoint: T

          The point that was updated

        Returns void