Module ObservablePoint-PIXI

class type _t = { ... }
type t = Js.t(_t);

The Point object represents a location in a two-dimensional coordinate system, where x represents the horizontal axis and y represents the vertical axis.

An ObservablePoint is a point that triggers a callback when the point's position is changed.

module Impl: { ... };
include Impl;
let create: cb:(unit => unit) => ?⁠scope:'a => ?⁠x:float => ?⁠y:float => unit => t;

creates a new observable point

parameter cb

callback when changed

parameter scope

owner of callback

parameter x

position of the point on the x axis

parameter y

position of the point on the y axis

returns

new point

let getX: Js.t(_t) => float;

position of the point on the x axis

let setX: Js.t(_t) => float => unit;

position of the point on the x axis

let getY: Js.t(_t) => float;

position of the point on the y axis

let setY: Js.t(_t) => float => unit;

position of the point on the y axis

let clone: Js.t(_t) => ?⁠cb:(unit => unit) => ?⁠scope:'a => unit => Js.t(_t);

Creates a clone of this point

parameter cb

callback when changed

parameter scope

owner of callback

returns

a copy of the point

let copyFrom: Js.t(_t) => p:Js.t(_t) => Js.t(_t);

Copies x and y from the given point

deprecated

consider using IPoint.copyFrom instead for Point support

see /bs-pixi/PIXI/IPoint-PIXI/#val-copyFrom

IPoint.copyFrom

parameter p

The point to copy from

returns

itself

let copyTo: Js.t(_t) => p:Js.t(_t) => Js.t(_t);

Copies x and y into the given point

deprecated

consider using IPoint.copyTo instead for Point support

see /bs-pixi/PIXI/IPoint-PIXI/#val-copyTo

IPoint.copyTo

parameter p

The point to copy

returns

Given point with values updated

let equals: Js.t(_t) => p:Js.t(_t) => bool;

Returns true if the given point is equal to this point

deprecated

consider using IPoint.equals instead for Point support

see /bs-pixi/PIXI/IPoint-PIXI/#val-equals

IPoint.equals

parameter p

The point to check

returns

Whether the given point equal to this point

let set: Js.t(_t) => ?⁠x:float => ?⁠y:float => unit => unit;

Sets the point to a new x and y position. If y is omitted, both x and y will be set to x.

parameter x

position of the point on the x axis

parameter y

position of the point on the y axis