Module RenderTexture-PIXI
class type _t = { ... }type t= Js.t(_t);A RenderTexture is a special texture that allows any PixiJS display object to be rendered to it. Hint: All DisplayObjects (i.e. Sprites) that render to a RenderTexture should be preloaded otherwise black rectangles will be drawn instead.
Hint-2: The actual memory allocation will happen on first render. You shouldn't create renderTextures each frame just to delete them after, try to reuse them.
let _createOptions: ?width:float => ?height:float => ?scaleMode:int => ?resolution:float => unit => Js.t({. width: Js.undefined(float), height: Js.undefined(float), scaleMode: Js.undefined(int), resolution: Js.undefined(float), });
let createOptions: ?width:float => ?height:float => ?scaleMode:PIXI.SCALE_MODES.t => ?resolution:float => unit => Js.t({. height: Js.undefined(float), resolution: Js.undefined(float), scaleMode: Js.undefined(int), width: Js.undefined(float), });create collection of options for base render texture creation
- parameter width
The width of the render texture
- parameter height
The height of the render texture
- parameter scaleMode
- parameter resolution
The resolution / device pixel ratio of the texture being generated
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 PIXI.Texture.Impl;
let empty: Js.t(PIXI.Texture._t);let white: Js.t(PIXI.Texture._t);let create: baseTexture:PIXI.BaseTexture.t => ?frame:PIXI.Rectangle.t => ?orig:PIXI.Rectangle.t => ?trim:PIXI.Rectangle.t => ?rotate:float => ?anchor:PIXI.Point.t => unit => PIXI.Texture.t;let get_frame: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t);let set_frame: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t) => unit;let getBaseTexture: Js.t(PIXI.Texture._t) => Js.t(PIXI.C1.baseTexture);let setBaseTexture: Js.t(PIXI.Texture._t) => Js.t(PIXI.C1.baseTexture) => unit;let getDefaultAnchor: Js.t(PIXI.Texture._t) => Js.t(PIXI.Point._t);let setDefaultAnchor: Js.t(PIXI.Texture._t) => Js.t(PIXI.Point._t) => unit;let getFrame: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t);let setFrame: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t) => unit;let getHeight: Js.t(PIXI.Texture._t) => float;let setHeight: Js.t(PIXI.Texture._t) => float => unit;let getNoFrame: Js.t(PIXI.Texture._t) => bool;let setNoFrame: Js.t(PIXI.Texture._t) => bool => unit;let getOrig: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t);let setOrig: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t) => unit;let getRequiresUpdate: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t);let setRequiresUpdate: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t) => unit;let getResolution: Js.t(PIXI.Texture._t) => float;let setResolution: Js.t(PIXI.Texture._t) => float => unit;let getRotate: Js.t(PIXI.Texture._t) => float;let setRotate: Js.t(PIXI.Texture._t) => float => unit;let getTextureCacheIds: Js.t(PIXI.Texture._t) => array(string);let setTextureCacheIds: Js.t(PIXI.Texture._t) => array(string) => unit;let getTrim: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t);let setTrim: Js.t(PIXI.Texture._t) => Js.t(PIXI.Rectangle._t) => unit;let getUvMatrix: Js.t(PIXI.Texture._t) => PIXI.TextureMatrix.t;let setUvMatrix: Js.t(PIXI.Texture._t) => PIXI.TextureMatrix.t => unit;let getValid: Js.t(PIXI.Texture._t) => float;let setValid: Js.t(PIXI.Texture._t) => float => unit;let getWidth: Js.t(PIXI.Texture._t) => float;let setWidth: Js.t(PIXI.Texture._t) => float => unit;let addToCache: texture:Js.t(PIXI.Texture._t) => id:string => unit;let from: ?source:[ `BaseTexture(PIXI.BaseTexture.t) | `HtmlCanvasElement(Webapi.Dom.HtmlElement.t) | `HtmlImageElement(Webapi.Dom.HtmlImageElement.t) | `HtmlVideoElement(Webapi.Dom.HtmlElement.t) | `String(string) ] => ?options:'a => ?strict:bool => unit => Js.t(PIXI.Texture._t);let fromBuffer: buffer:[ `Float32Array(Js.Typed_array.Float32Array.t) | `UInt8Array(Js.Typed_array.Uint8Array.t) ] => width:float => height:float => ?options:'a => unit => Js.t(PIXI.Texture._t);let fromLoader: source:[ `HTMLCanvasElement(Webapi.Dom.HtmlElement.t) | `HTMLImageElement(Webapi.Dom.HtmlImageElement.t) ] => imageUrl:string => ?name:string => unit => Js.t(PIXI.Texture._t);let removeFromCache: texture:[ `String(string) | `Texture(PIXI.Texture.t) ] => Js.Nullable.t(Js.t(PIXI.Texture._t));let clone: Js.t(PIXI.Texture._t) => unit;let destroy: Js.t(PIXI.Texture._t) => ?destroyBase:bool => unit => unit;let update: Js.t(PIXI.Texture._t) => unit;let updateUvs: Js.t(PIXI.Texture._t) => unit;
include Impl;
let create: baseRenderTexture:Js.t(PIXI.BaseRenderTexture.#_t) => ?frame:Js.t(PIXI.Rectangle.#_t) => unit => t;let _create_: ?options:'a => unit => t;
let create_: ?options:Js.t({. height: Js.undefined(float), resolution: Js.undefined(float), scaleMode: Js.undefined(int), width: Js.undefined(float), }) => unit => t;A short hand way of creating a render texture
- see /bs-pixi/PIXI/RenderTexture-PIXI/#val-createOptions
for options RenderTexture.createOptions
- parameter options
collection of options
let getFilterFrame: Js.t(_t) => Js.t(PIXI.Rectangle.#_t);Stores sourceFrame when this texture is inside current filter stack. You can read it inside filters.
let setFilterFrame: Js.t(_t) => Js.t(PIXI.Rectangle.#_t) => unit;Stores sourceFrame when this texture is inside current filter stack. You can read it inside filters.
let getValid: Js.t(_t) => bool;This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
let setValid: Js.t(_t) => bool => unit;This will let the renderer know if the texture is valid. If it's not then it cannot be rendered.
let resize: Js.t(_t) => width:float => height:float => ?resizeBaseTexture:bool => unit => unit;Resizes the RenderTexture
- parameter width
The width to resize to.
- parameter height
The height to resize to.
- parameter resizeBaseTexture
Should the baseTexture.width and height values be resized as well?
let setResolution: Js.t(_t) => resolution:float => unit;Changes the resolution of baseTexture, but does not change framebuffer size.
- parameter resolution
The new resolution to apply to RenderTexture