Module Mesh-PIXI.Impl

let _create: geometry:PIXI.Geometry.t => shader:[ `Shader(PIXI.Shader.t) | `MeshMaterial(PIXI.MeshMaterial.t) ] => ?⁠state:PIXI.State.t => ?⁠drawMode:int => unit => Js.t(_t);
let create: geometry:PIXI.Geometry.t => shader:[ `MeshMaterial(PIXI.MeshMaterial.t) | `Shader(PIXI.Shader.t) ] => ?⁠state:PIXI.State.t => ?⁠drawMode:PIXI.DRAW_MODES.t => unit => Js.t(_t);

creates a new mesh instance

parameter geometry

the geometry the mesh will use

parameter shader

the shader the mesh will use

parameter state

the state that the WebGL context is required to be in to render the mesh if no state is provided, uses PIXI.State.for2d to create a 2D state for PixiJS.

parameter drawMode

the drawMode, can be any of the PIXI.DRAW_MODES consts

let batchableSize: int;

The maximum number of vertices to consider batchable. Generally, the complexity of the geometry.

let getBlendMode: Js.t(_t) => PIXI.BLEND_MODES.t;

The maximum number of vertices to consider batchable. Generally, the complexity of the geometry.

let getDrawMode: Js.t(_t) => PIXI.DRAW_MODES.t;

The way the Mesh should be drawn, can be any of the PIXI.DRAW_MODES constants.

let setBlendMode: Js.t(_t) => PIXI.BLEND_MODES.t => unit;

The blend mode to be applied to the Mesh. Apply a value of PIXI.BLEND_MODES.NORMAL to reset the blend mode.

let setDrawMode: Js.t(_t) => PIXI.DRAW_MODES.t => unit;

The blend mode to be applied to the Mesh. Apply a value of PIXI.BLEND_MODES.NORMAL to reset the blend mode

let getGeometry: Js.t(_t) => Js.t(PIXI.Geometry.#_t);

Includes vertex positions, face indices, normals, colors, UVs, and custom attributes within buffers, reducing the cost of passing all this data to the GPU. Can be shared between multiple Mesh objects.

let getMaterial: Js.t(_t) => Js.t(PIXI.MeshMaterial.#_t);

Alias for PIXI.Mesh#shader.

let setMaterial: Js.t(_t) => Js.t(PIXI.MeshMaterial.#_t) => unit;

Alias for PIXI.Mesh#shader.

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

If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less smooth. To set the global default, change PIXI.settings.ROUND_PIXELS

let setRoundPixels: Js.t(_t) => bool => unit;

If true PixiJS will Math.floor() x/y values when rendering, stopping pixel interpolation. Advantages can include sharper image quality (like text) and faster rendering on canvas. The main disadvantage is movement of objects may appear less smooth. To set the global default, change PIXI.settings.ROUND_PIXELS

let getShader: Js.t(_t) => Js.t(PIXI.Shader.#_t);

Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. Can be shared between multiple Mesh objects.

let setShader: Js.t(_t) => Js.t(PIXI.Shader.#_t) => unit;

Represents the vertex and fragment shaders that processes the geometry and runs on the GPU. Can be shared between multiple Mesh objects.

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

How much of the geometry to draw, by default 0 renders everything.

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

How much of the geometry to draw, by default 0 renders everything.

let getStart: Js.t(_t) => int;

Typically the index of the IndexBuffer where to start drawing.

let setStart: Js.t(_t) => int => unit;

Typically the index of the IndexBuffer where to start drawing.

let getState: Js.t(_t) => Js.t(PIXI.State.#_t);

Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g., blend mode, culling, depth testing, direction of rendering triangles, backface, etc.

let setState: Js.t(_t) => Js.t(PIXI.State.#_t) => unit;

Represents the WebGL state the Mesh required to render, excludes shader and geometry. E.g., blend mode, culling, depth testing, direction of rendering triangles, backface, etc.

let getTexture: Js.t(_t) => Js.t(PIXI.Texture.#_t);

The texture that the Mesh uses.

let setTexture: Js.t(_t) => Js.t(PIXI.Texture.#_t) => unit;

The texture that the Mesh uses.

let getTint: Js.t(_t) => int;

The multiply tint applied to the Mesh. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

let setTint: Js.t(_t) => int => unit;

The multiply tint applied to the Mesh. This is a hex value. A value of 0xFFFFFF will remove any tint effect.

let getUvBuffer: Js.t(_t) => Js.t(PIXI.Buffer.#_t);

To change mesh uv's, change its uvBuffer data and increment its _updateID.

let getVerticesBuffer: Js.t(_t) => Js.t(PIXI.Buffer.#_t);

To change mesh vertices, change its uvBuffer data and increment its _updateID. Incrementing _updateID is optional because most of Mesh objects do it anyway.

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

Updates uv field based on from geometry uv's or batchUvs

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

Updates vertexData field based on transform and vertices

let containsPoint: Js.t(_t) => point:PIXI.Point.t => bool;

Tests if a point is inside this mesh. Works only for PIXI.DRAW_MODES.TRIANGLES.

let destroy: Js.t(_t) => ?⁠options:Js.t({. children: bool, }) => unit => unit;

Destroys the Mesh object.