Global

Global

Members

require

parse-uri - Lightweight module for parse an URI.

Version:
  • v1.0.0
License:
  • MIT

Methods

clearMetrics (font)

Clear font metrics in metrics cache.

Name Type Description
font string optional

font name. If font name not set then clear cache for all fonts.

encodeBinary (input)string

Encodes binary into base64.

Name Type Description
input string

The input data to encode.

Returns:
Type Description
string The encoded base64 string

Calculates the ascent, descent and fontSize of a given font-style

Name Type Description
font string

String representing the style of the font

Returns:
Type Description
PIXI.TextMetrics~FontMetrics Font properties object

measureText (text, style, wordWrap, canvas)PIXI.TextMetrics

Measures the supplied string of text and returns a Rectangle.

Name Type Description
text string

the text to measure.

style PIXI.TextStyle

the text style to use for measuring

wordWrap boolean optional

optional override for if word-wrap should be applied to the text.

canvas HTMLCanvasElement optional

optional specification of the canvas to use for measuring.

Returns:
Type Description
PIXI.TextMetrics measured width and height of the text.

setPrecision (src, precision)string

Sets the float precision on the shader. If the precision is already present this function will do nothing

Name Type Description
src string

the shader source

precision string

The float precision of the shader. Options are 'lowp', 'mediump' or 'highp'.

Returns:
Type Description
string modified shader source

setVertexAttribArrays (gl, attribs, state)

Name Type Description
gl WebGLRenderingContext

The current WebGL context

attribs *
state *

Type Definitions

IAddOptions object

Options for a call to .add().

Properties:
Name Type Argument Default Description
name string <optional>

The name of the resource to load, if not passed the url is used.

key string <optional>

Alias for name.

url string <optional>

The url for this resource, relative to the baseUrl of this loader.

crossOrigin string | boolean <optional>

Is this request cross-origin? Default is to determine automatically.

timeout number <optional>
0

A timeout in milliseconds for the load. If the load takes longer than this time it is cancelled and the load is considered a failure. If this value is set to 0 then there is no explicit timeout.

loadType Resource.LOAD_TYPE <optional>
Resource.LOAD_TYPE.XHR

How should this resource be loaded?

xhrType Resource.XHR_RESPONSE_TYPE <optional>
Resource.XHR_RESPONSE_TYPE.DEFAULT

How should the data being loaded be interpreted when using XHR?

onComplete Resource.OnCompleteSignal <optional>

Callback to add an an onComplete signal istener.

callback Resource.OnCompleteSignal <optional>

Alias for onComplete.

metadata Resource.IMetadata <optional>

Extra configuration for middleware and the Resource object.

See:
  • Loader#add