Module BaseTexture-PIXI.Impl

let _create: ?⁠resource:[ `Resource(PIXI.Resource.t) | `String(string) | `HTMLImageElement(Webapi.Dom.HtmlImageElement.t) | `HTMLCanvasElement(Webapi.Dom.Element.t) | `HTMLVideoElement(Webapi.Dom.Element.t) ] => ?⁠options:'a => unit => t;
let create: resource:[ `HTMLCanvasElement(Webapi.Dom.Element.t) | `HTMLImageElement(Webapi.Dom.HtmlImageElement.t) | `HTMLVideoElement(Webapi.Dom.Element.t) | `Resource(PIXI.Resource.t) | `String(string) ] => ?⁠options:Js.t({. _type: Js.undefined(int), alphaMode: Js.undefined(int), anisotropicLevel: Js.undefined(int), format: Js.undefined(int), height: Js.undefined(float), mipmap: Js.undefined(int), resolution: Js.undefined(float), resourceOptions: Js.undefined(Js.t({. })), scaleMode: Js.undefined(int), target: Js.undefined(int), width: Js.undefined(float), wrapMode: Js.undefined(int), }) => unit => t;

creates a new base texture

see /bs-pixi/PIXI/BaseTexture-PIXI/#val-createOptions

for options BaseTexture.createOptions

parameter resource

The current resource to use, for things that aren't Resource objects, will be converted into a Resource.

parameter options

collection of options

let get_BatchEnabled: Js.t(PIXI.C1.#baseTexture) => int;

number of the texture batch, used by multi-texture renderers

let set_BatchEnabled: Js.t(PIXI.C1.#baseTexture) => int => unit;

number of the texture batch, used by multi-texture renderers

let get_BatchLocation: Js.t(PIXI.C1.#baseTexture) => int;

location inside texture batch, used by multi-texture renderers

let set_BatchLocation: Js.t(PIXI.C1.#baseTexture) => int => unit;

location inside texture batch, used by multi-texture renderers

let _getAlphaMode: Js.t(PIXI.C1.#baseTexture) => int;
let getAlphaMode: Js.t(PIXI.C1.baseTexture) => PIXI.ALPHA_MODES.t;

How to treat premultiplied alpha

let _setAlphaMode: Js.t(PIXI.C1.#baseTexture) => int => unit;
let setAlphaMode: Js.t(PIXI.C1.baseTexture) => PIXI.ALPHA_MODES.t => unit;

How to treat premultiplied alpha

let getAnisotropicLevel: Js.t(PIXI.C1.#baseTexture) => float;

anisotropic filtering level of texture

let setAnisotropicLevel: Js.t(PIXI.C1.#baseTexture) => float => unit;

anisotropic filtering level of texture

let getCacheId: Js.t(PIXI.C1.#baseTexture) => string;

Currently default cache ID

let setCacheId: Js.t(PIXI.C1.#baseTexture) => string => unit;

Currently default cache ID

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

flag if BaseTexture has been destroyed

let getDirtyId: Js.t(PIXI.C1.#baseTexture) => int;

used by TextureSystem to only update texture to the GPU when needed. Please call update() to increment it

let getFormat: Js.t(PIXI.C1.#baseTexture) => int;

the pixel format of the texture

let getHeight: Js.t(PIXI.C1.#baseTexture) => int;

The height of the base texture set when the image has loaded

let getIsPowerOfTwo: Js.t(PIXI.C1.#baseTexture) => bool;

Whether or not the texture is a power of two, try to use power of two textures as much as you can

let _getMipmap: Js.t(PIXI.C1.#baseTexture) => int;
let getMipmap: Js.t(PIXI.C1.baseTexture) => PIXI.MIPMAP_MODES.t;

Mipmap mode of the texture, affects downscaled images

let _setMipmap: Js.t(PIXI.C1.#baseTexture) => int => unit;
let setMipmap: Js.t(PIXI.C1.baseTexture) => PIXI.MIPMAP_MODES.t => unit;

Mipmap mode of the texture, affects downscaled images

let getRealHeight: Js.t(PIXI.C1.#baseTexture) => float;

Pixel height of the source of this texture

let getRealWeight: Js.t(PIXI.C1.#baseTexture) => float;

Pixel width of the source of this texture

let getResolution: Js.t(PIXI.C1.#baseTexture) => float;

The resolution / device pixel ratio of the texture

let setResolution: Js.t(PIXI.C1.#baseTexture) => float => unit;

The resolution / device pixel ratio of the texture

let getScaleMode: Js.t(PIXI.C1.#baseTexture) => int;

The scale mode to apply when scaling this texture

let setScaleMode: Js.t(PIXI.C1.#baseTexture) => int => unit;

The scale mode to apply when scaling this texture

let _getTarget: Js.t(PIXI.C1.#baseTexture) => int;
let getTarget: Js.t(PIXI.C1.baseTexture) => PIXI.TARGETS.t;

Mipmap mode of the texture, affects downscaled images

let _setTarget: Js.t(PIXI.C1.#baseTexture) => int => unit;
let setTarget: Js.t(PIXI.C1.baseTexture) => PIXI.TARGETS.t => unit;

Mipmap mode of the texture, affects downscaled images

let getTextureCacheIds: Js.t(PIXI.C1.#baseTexture) => array(string);

The collection of alternative cache ids, since some BaseTextures can have more than one ID short name and longer full URL

let getUid: Js.t(PIXI.C1.#baseTexture) => string;

Global unique identifier for this BaseTexture

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

Generally speaking means when resource is loaded

let getWidth: Js.t(PIXI.C1.#baseTexture) => bool;

The width of the base texture set when the image has loaded

let _getWrapMode: Js.t(PIXI.C1.#baseTexture) => int;
let getWrapMode: Js.t(PIXI.C1.baseTexture) => PIXI.WRAP_MODES.t;

How the texture wraps

let _setWrapMode: Js.t(PIXI.C1.#baseTexture) => int => unit;
let setWrapMode: Js.t(PIXI.C1.baseTexture) => PIXI.WRAP_MODES.t => unit;

How the texture wraps

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

Destroys this base texture. The method stops if resource doesn't want this texture to be destroyed. Removes texture from all caches.

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

Frees the texture from WebGL memory without destroying this texture object. This means you can still use the texture later which will upload it to GPU memory again

let _getDrawableSource: Js.t(PIXI.C1.#baseTexture) => Webapi.Dom.HtmlElement.t;
let getDrawableSource: Js.t(PIXI.C1.baseTexture) => PIXI.ICanvasImageSource.t;

Get the drawable source, such as HTMLCanvasElement or HTMLImageElement suitable for rendering with CanvasRenderer. Provided by @pixi/canvas-renderer package

raises Failure

when drawable source is not recognized

returns

Source to render with CanvasRenderer

let setRealSize: Js.t(PIXI.C1.#baseTexture) => realWidth:float => realHeight:float => ?⁠resolution:float => unit => Js.t(PIXI.C1.#baseTexture);

Sets real size of baseTexture, preserves current resolution.

parameter realWidth

Full rendered width

parameter realHeight

Full rendered height

parameter resolution

Optionally set resolution

returns

itself

let setResolution: Js.t(PIXI.C1.#baseTexture) => resolution:float => Js.t(PIXI.C1.#baseTexture);

Changes resolution

parameter resolution

res

returns

itself

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

Sets the resource if it wasn't set. Throws error if resource already present

parameter resource

that is managing this BaseTexture

returns

itself

let setSize: Js.t(PIXI.C1.#baseTexture) => width:float => height:float => ?⁠resolution:float => unit => Js.t(PIXI.C1.#baseTexture);

Changes w/h/resolution. Texture becomes valid if width and height are greater than zero

parameter width

visual width

parameter height

visual height

parameter resolution

(optional) optionally set resolution

returns

itself

let _setStyle: Js.t(PIXI.C1.#baseTexture) => ?⁠scaleMode:int => ?⁠mipmap:int => unit => Js.t(PIXI.C1.#baseTexture);
let setStyle: Js.t(PIXI.C1.baseTexture) => scaleMode:option(PIXI.SCALE_MODES.t) => mipmap:option(PIXI.MIPMAP_MODES.t) => unit => Js.t(PIXI.C1.baseTexture);

Changes style options of BaseTexture

parameter scaleMode

(optional) Pixi scalemode @parm mipmap (optional) enable mipmaps

returns

itself

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

Invalidates the object. Texture becomes valid if width and height are greater than zero