Namespace: Utils

Phaser.Renderer.WebGL. Utils

Since: 3.0.0
Source: src/renderer/webgl/Utils.js (Line 8)

Methods


<static> getComponentCount(attributes, glContext)

Counts how many attributes of 32 bits a vertex has

Parameters:
Name Type Description
attributes array

Array of attributes

glContext WebGLRenderingContext

WebGLContext used for check types

Since: 3.0.0
Source: src/renderer/webgl/Utils.js (Line 97)
Returns:

Count of 32 bit attributes in vertex

Type
number

<static> getFloatsFromUintRGB(rgb)

Unpacks a Uint24 RGB into an array of floats of ranges of 0.0 and 1.0

Parameters:
Name Type Description
rgb number

RGB packed as a Uint24

Since: 3.0.0
Source: src/renderer/webgl/Utils.js (Line 78)
Returns:

Array of floats representing each component as a float

Type
array

<static> getTintAppendFloatAlpha(rgb, a)

Packs a Uint24, representing RGB components, with a Float32, representing the alpha component, with a range between 0.0 and 1.0 and return a Uint32

Parameters:
Name Type Description
rgb number

Uint24 representing RGB components

a number

Float32 representing Alpha component

Since: 3.0.0
Source: src/renderer/webgl/Utils.js (Line 37)
Returns:

Packed RGBA as Uint32

Type
number

<static> getTintAppendFloatAlphaAndSwap(rgb, a)

Packs a Uint24, representing RGB components, with a Float32, representing the alpha component, with a range between 0.0 and 1.0 and return a swizzled Uint32

Parameters:
Name Type Description
rgb number

Uint24 representing RGB components

a number

Float32 representing Alpha component

Since: 3.0.0
Source: src/renderer/webgl/Utils.js (Line 55)
Returns:

Packed RGBA as Uint32

Type
number

<static> getTintFromFloats(r, g, b, a)

Packs four floats on a range from 0.0 to 1.0 into a single Uint32

Parameters:
Name Type Description
r number

Red component in a range from 0.0 to 1.0

g number

Green component in a range from 0.0 to 1.0

b number

Blue component in a range from 0.0 to 1.0

a number

Alpha component in a range from 0.0 to 1.0

Since: 3.0.0
Source: src/renderer/webgl/Utils.js (Line 14)
Returns:

[description]

Type
number