Module Resource-PIXI

type t = Js.t(PIXI.C1.resource);

Base resource class for textures that manages validation and uploading, depending on its type. Uploading of a base texture to the GPU is required.

module Impl: { ... };
include Impl;
let create: ?⁠width:float => ?⁠height:float => unit => t;

creates new resource

parameter width

width of the resource

parameter height

height of the resource

let getDestroyed: Js.t(PIXI.C1.#resource) => bool;

if resource has been destroyed

let getHeight: Js.t(PIXI.C1.#resource) => float;

the height of the resource.

let getValid: Js.t(PIXI.C1.#resource) => bool;

has been validated

let getWidth: Js.t(PIXI.C1.#resource) => float;

the width of the resource.

let bind: Js.t(PIXI.C1.#resource) => baseTexture:Js.t(PIXI.C1.#baseTexture) => unit;

bind to a parent BaseTexture

parameter baseTexture

parent texture

let destroy: Js.t(PIXI.C1.#resource) => unit;

Call when destroying resource, unbind any BaseTexture object before calling this method, as reference counts are maintained internally

let resize: Js.t(PIXI.C1.#resource) => width:float => height:float => unit => unit;

trigger a resize event

parameter width

X dimension

parameter width

Y dimension

let style: Js.t(PIXI.C1.#resource) => renderer:Js.t(PIXI.Renderer.#_t) => baseTexture:Js.t(PIXI.C1.#baseTexture) => glTexture:PIXI.GLTexture.t => bool;

set the style, optional to override

parameter renderer

yeah, renderer!

parameter baseTexture

the texture

parameter glTexture

texture instance for this webgl context

returns

true if success

let unbind: Js.t(PIXI.C1.#resource) => baseTexture:Js.t(PIXI.C1.#baseTexture) => unit;

unbind to a parent BaseTexture

parameter baseTexture

parent texture

let update: Js.t(PIXI.C1.#resource) => unit;

has been updated trigger event

let upload: Js.t(PIXI.C1.#resource) => renderer:Js.t(PIXI.Renderer.#_t) => baseTexture:Js.t(PIXI.C1.#baseTexture) => glTexture:PIXI.GLTexture.t => bool;

uploads the texture or returns false if it cant for some reason. Override this.

parameter renderer

yeah, renderer!

parameter baseTexture

the texture

parameter gTexture

texture instance of this webgl context