Module DisplayObject-PIXI
type t= Js.t(PIXI.C.displayObject);The base class for all objects that are rendered on the screen. This is an abstract class and should not be used on its own; rather it should be extended
module Impl: { ... };include PIXI.EventEmitter.Impl;
let create: unit => PIXI.EventEmitter.t;let eventNames: Js.t(PIXI.EventEmitter._t) => array(string);let listeners: Js.t(PIXI.EventEmitter._t) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => array((Js.t({.. }) => unit));let listenerCount: Js.t(PIXI.EventEmitter._t) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => int;let emit: Js.t(PIXI.EventEmitter._t) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => bool;let on: Js.t(PIXI.EventEmitter._t as 'd) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => fn:('b => unit) => ?context:'c => unit => Js.t('d);let addListener: Js.t(PIXI.EventEmitter._t as 'd) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => fn:('b => unit) => ?context:'c => unit => Js.t('d);let once: Js.t(PIXI.EventEmitter._t as 'd) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => fn:('b => unit) => ?context:'c => unit => Js.t('d);let removeListener: Js.t(PIXI.EventEmitter._t as 'b) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => ?fn:(Js.t({.. }) => unit) => ?context:Js.t({.. }) => ?once:bool => unit => Js.t('b);let off: Js.t(PIXI.EventEmitter._t as 'b) => event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => ?fn:(Js.t({.. }) => unit) => ?context:Js.t({.. }) => ?once:bool => unit => Js.t('b);let removeAllListeners: Js.t(PIXI.EventEmitter._t as 'b) => ?event:[ `String(string) | `Symbol(PIXI.Symbol.t) ] => unit => Js.t('b);
include Impl;
let create: unit => t;let getAccessible: Js.t(PIXI.C.#displayObject) => bool;Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set
let setAccessible: Js.t(PIXI.C.#displayObject) => bool => unit;Flag for if the object is accessible. If true AccessibilityManager will overlay a shadow div with attributes set
let getAccessibleChildren: Js.t(PIXI.C.#displayObject) => bool;Setting to false will prevent any children inside this container to be accessible. Defaults to true
let setAccessibleChildren: Js.t(PIXI.C.#displayObject) => bool => unit;Setting to false will prevent any children inside this container to be accessible. Defaults to true
let getAccessibleHint: Js.t(PIXI.C.#displayObject) => string;Sets the aria-label attribute of the shadow div
let setAccessibleHint: Js.t(PIXI.C.#displayObject) => string => unit;Sets the aria-label attribute of the shadow div
let getAccessibleTitle: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(string);Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'displayObject
tabIndex'
let setAccessibleTitle: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(string) => unit;Sets the title attribute of the shadow div If accessibleTitle AND accessibleHint has not been this will default to 'displayObject
tabIndex'
let getAccessibleType: Js.t(PIXI.C.#displayObject) => string;Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.
let setAccessibleType: Js.t(PIXI.C.#displayObject) => string => unit;Specify the type of div the accessible layer is. Screen readers treat the element differently depending on this type. Defaults to button.
let getAlpha: Js.t(PIXI.C.#displayObject) => float;The opacity of the object
let setAlpha: Js.t(PIXI.C.#displayObject) => float => unit;The opacity of the object
let getAngle: Js.t(PIXI.C.#displayObject) => float;The angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees
let setAngle: Js.t(PIXI.C.#displayObject) => float => unit;The angle of the object in degrees. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees
let getButtonMode: Js.t(PIXI.C.#displayObject) => bool;If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive Setting this changes the 'cursor' property to 'pointer'.
let setButtonMode: Js.t(PIXI.C.#displayObject) => bool => unit;If enabled, the mouse cursor use the pointer behavior when hovered over the displayObject if it is interactive Setting this changes the 'cursor' property to 'pointer'.
let getCacheAsBitmap: Js.t(PIXI.C.#displayObject) => bool;Set this to true if you want this display object to be cached as a bitmap. This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. To remove simply set this property to false
IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
let setCacheAsBitmap: Js.t(PIXI.C.#displayObject) => bool => unit;Set this to true if you want this display object to be cached as a bitmap. This basically takes a snap shot of the display object as it is at that moment. It can provide a performance benefit for complex static displayObjects. To remove simply set this property to false
IMPORTANT GOTCHA - Make sure that all your textures are preloaded BEFORE setting this property to true as it will take a snapshot of what is currently there. If the textures have not loaded then they will not appear.
let getCursor: Js.t(PIXI.C.#displayObject) => string;The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. Also works as an interaction mask.
let setCursor: Js.t(PIXI.C.#displayObject) => string => unit;The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. Also works as an interaction mask.
let getFilterArea: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(Js.t(PIXI.Rectangle.#_t));The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. Also works as an interaction mask.
let setFilterArea: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(Js.t(PIXI.Rectangle.#_t)) => unit;The area the filter is applied to. This is used as more of an optimization rather than figuring out the dimensions of the displayObject each frame you can set this rectangle. Also works as an interaction mask.
let getFilters: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(array(PIXI.Filter.t));Sets the filters for the displayObject.
IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. To remove filters simply set this property to 'null'.
let setFilters: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(array(PIXI.Filter.t)) => unit;Sets the filters for the displayObject.
IMPORTANT: This is a WebGL only feature and will be ignored by the canvas renderer. To remove filters simply set this property to 'null'.
let getHitArea: Js.t(PIXI.C.#displayObject) => 'hitArea;Interaction shape. Children will be hit first, then this shape will be checked. Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
let setHitArea: Js.t(PIXI.C.#displayObject) => 'hitArea => unit;Interaction shape. Children will be hit first, then this shape will be checked. Setting this will cause this shape to be checked in hit tests rather than the displayObject's bounds.
let getInteractive: Js.t(PIXI.C.#displayObject) => bool;Enable interaction events for the DisplayObject. Touch, pointer and mouse events will not be emitted unless interactive is set to true.
let setInteractive: Js.t(PIXI.C.#displayObject) => bool => unit;Enable interaction events for the DisplayObject. Touch, pointer and mouse events will not be emitted unless interactive is set to true.
let getIsMask: Js.t(PIXI.C.#displayObject) => bool;Does any other displayObject use this object as a mask?
let getIsSprite: Js.t(PIXI.C.#displayObject) => bool;used to fast check if a sprite is.. a sprite!
let getLocalTransform: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.Matrix.#_t);Current transform of the object based on local factors: position, scale, other stuff.
let getMask: Js.t(PIXI.C.#displayObject) => 'mask;Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. In PixiJS a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilities shape clipping. To remove a mask, set this property to null.
For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
let setMask: Js.t(PIXI.C.#displayObject) => 'mask => unit;Sets a mask for the displayObject. A mask is an object that limits the visibility of an object to the shape of the mask applied to it. In PixiJS a regular mask must be a PIXI.Graphics or a PIXI.Sprite object. This allows for much faster masking in canvas as it utilities shape clipping. To remove a mask, set this property to null.
For sprite mask both alpha and red channel are used. Black mask is the same as transparent mask.
let getName: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(string);The instance name of the object.
let setName: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(string) => unit;The instance name of the object.
let getParent: Js.t(PIXI.C.#displayObject) => Js.Nullable.t(PIXI.C.#container);The display object container that contains this display object.
let getPivot: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t);The pivot point of the displayObject that it rotates around. Assignment by value since pixi-v4.
let setPivot: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t) => unit;The pivot point of the displayObject that it rotates around. Assignment by value since pixi-v4.
let getPosition: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t);The coordinate of the object relative to the local coordinates of the parent. Assignment by value since pixi-v4.
let setPosition: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t) => unit;The coordinate of the object relative to the local coordinates of the parent. Assignment by value since pixi-v4.
let getRenderable: Js.t(PIXI.C.#displayObject) => bool;Can this object be rendered, if false the object will not be drawn but the updateTransform methods will still be called. Only affects recursive calls from parent. You can ask for bounds manually.
let setRenderable: Js.t(PIXI.C.#displayObject) => bool => unit;Can this object be rendered, if false the object will not be drawn but the updateTransform methods will still be called. Only affects recursive calls from parent. You can ask for bounds manually.
let getRotation: Js.t(PIXI.C.#displayObject) => float;The rotation of the object in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
let setRotation: Js.t(PIXI.C.#displayObject) => float => unit;The rotation of the object in radians. 'rotation' and 'angle' have the same effect on a display object; rotation is in radians, angle is in degrees.
let getScale: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t);The scale factor of the object. Assignment by value since pixi-v4.
let setScale: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t) => unit;The scale factor of the object. Assignment by value since pixi-v4.
let getSkew: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t);The skew factor for the object in radians. Assignment by value since pixi-v4.
let setSkew: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.ObservablePoint.#_t) => unit;The skew factor for the object in radians. Assignment by value since pixi-v4.
let getTransform: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.Transform.#_t);World transform and local transform of this object. This will become read-only later, please do not assign anything there unless you know what are you doing.
let setTransform: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.Transform.#_t) => unit;World transform and local transform of this object. This will become read-only later, please do not assign anything there unless you know what are you doing.
let getVisible: Js.t(PIXI.C.#displayObject) => bool;The visibility of the object. If false the object will not be drawn, and the updateTransform function will not be called. Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
let setVisible: Js.t(PIXI.C.#displayObject) => bool => unit;The visibility of the object. If false the object will not be drawn, and the updateTransform function will not be called. Only affects recursive calls from parent. You can ask for bounds or call updateTransform manually.
let getWorldAlpha: Js.t(PIXI.C.#displayObject) => float;The multiplied alpha of the displayObject.
let getWorldTransform: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.Matrix.#_t);Current transform of the object based on world (parent) factors.
let getWorldVisible: Js.t(PIXI.C.#displayObject) => bool;Indicates if the object is globally visible.
let getX: Js.t(PIXI.C.#displayObject) => float;The position of the displayObject on the x axis relative to the local coordinates of the parent. An alias to position.x
let setX: Js.t(PIXI.C.#displayObject) => float => unit;The position of the displayObject on the x axis relative to the local coordinates of the parent. An alias to position.x
let getY: Js.t(PIXI.C.#displayObject) => float;The position of the displayObject on the y axis relative to the local coordinates of the parent. An alias to position.y
let setY: Js.t(PIXI.C.#displayObject) => float => unit;The position of the displayObject on the y axis relative to the local coordinates of the parent. An alias to position.y
let getZIndex: Js.t(PIXI.C.#displayObject) => float;The zIndex of the displayObject. If a container has the sortableChildren property set to true, children will be automatically sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, and thus rendered on top of other displayObjects within the same container.
let setZIndex: Js.t(PIXI.C.#displayObject) => float => unit;The zIndex of the displayObject. If a container has the sortableChildren property set to true, children will be automatically sorted by zIndex value; a higher value will mean it will be moved towards the end of the array, and thus rendered on top of other displayObjects within the same container.
let _recursivePostUpdateTransform: Js.t(PIXI.C.#displayObject) => unit;Recursively updates transform of all objects from the root to this one internal function for toLocal()
let destroy: Js.t(PIXI.C.#displayObject) => unit;Base destroy method for generic display objects. This will automatically remove the display object from its parent Container as well as remove all current event listeners and internal references. Do not use a DisplayObject after calling destroy().
let getBounds: Js.t(PIXI.C.#displayObject) => ?skipUpdate:bool => ?rect:Js.t(PIXI.Rectangle.#_t) => unit => Js.t(PIXI.Rectangle.#_t);Retrieves the bounds of the displayObject as a rectangle object.
- parameter skipUpdate
Setting to true will stop the transforms of the scene graph from being updated. This means the calculation returned MAY be out of date BUT will give you a nice performance boost.
- parameter rect
Optional rectangle to store the result of the bounds calculation.
let getGlobalPosition: Js.t(PIXI.C.#displayObject) => ?point:Js.t(PIXI.Point.#_t) => ?skipUpdate:bool => unit => Js.t(PIXI.Point.#_t);Returns the global position of the displayObject. Does not depend on object scale, rotation and pivot.
let getLocalBounds: Js.t(PIXI.C.#displayObject) => ?rectangle:Js.t(PIXI.Rectangle.#_t) => unit => Js.t(PIXI.Rectangle.#_t);Retrieves the local bounds of the displayObject as a rectangle object
let setContainer: Js.t(PIXI.C.#displayObject) => Js.t(PIXI.C.#container as 'a) => Js.t('a);Set the parent Container of this DisplayObject.
let setTransform: Js.t(PIXI.C.#displayObject) => ?x:float => ?y:float => ?scaleX:float => ?scaleY:float => ?rotation:float => ?skewX:float => ?skewY:float => ?pivotX:float => ?pivotY:float => unit => t;Convenience function to set the position, scale, skew and pivot at once.
- parameter x
Position on the x axis
- parameter y
Position on the y axis
- parameter pivotX
Pivot on the x axis
- parameter pivotY
Pivot on the y axis
- parameter scaleX
Scale on the x axis
- parameter scaleY
Scale on the y axis
- parameter rotation
rotation in radians
- parameter skewX
Skew on the x axis
- parameter skewY
Skew on the y axis
- parameter pivotX
The X pivot value
- parameter pivotY
The Y pivot value
- returns
This display object
let toGlobal: Js.t(PIXI.C.#displayObject) => position:[ `Point(PIXI.Point.t) | `ObservablePoint(PIXI.ObservablePoint.t) ] => ?point:PIXI.Point.t => ?skipUpdate:bool => unit => PIXI.Point.t;Calculates the global position of the display object.
let toLocal: Js.t(PIXI.C.#displayObject) => position:[ `Point(PIXI.Point.t) | `ObservablePoint(PIXI.ObservablePoint.t) ] => ?from:t => ?point:PIXI.Point.t => ?skipUpdate:bool => unit => PIXI.Point.t;Calculates the local position of the display object relative to another point.
let updateTransform: Js.t(PIXI.C.#displayObject) => unit;Updates the object transform for rendering.