LogoPixi’VN
pixi-jsInterfaces

Interface: Observer<T>

Defined in: node_modules/pixi.js/lib/maths/point/ObservablePoint.d.ts:34

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

Example

// 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)

Remarks

  • Used internally by ObservablePoint
  • Triggered on x/y changes
  • Can track multiple points
  • Useful for change detection

See

Standard

Type Parameters

T

T

The type of point being observed

Properties

_onUpdate

> _onUpdate: (point?) => void

Defined in: node_modules/pixi.js/lib/maths/point/ObservablePoint.d.ts:40

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

Parameters

point?

T

The point that was updated

Returns

void