Phaser.Math.Pow2

Scope: static

Source: src/math/pow2/index.js#L7

Static functions

GetNext

<static> GetNext(value)

Description:

Returns the nearest power of 2 to the given value.

Parameters:

name

type

optional

description

value

number

No

The value.

Returns: number - The nearest power of 2 to value.

Source: src/math/pow2/GetPowerOfTwo.js#L7
Since: 3.0.0


IsSize

<static> IsSize(width, height)

Description:

Checks if the given width and height are a power of two. Useful for checking texture dimensions.

Parameters:

name

type

optional

description

width

number

No

The width.

height

number

No

The height.

Returns: boolean - true if width and height are a power of two, otherwise false.

Source: src/math/pow2/IsSizePowerOfTwo.js#L7
Since: 3.0.0


IsValue

<static> IsValue(value)

Description:

Tests the value and returns true if it is a power of two.

Parameters:

name

type

optional

description

value

number

No

The value to check if it's a power of two.

Returns: boolean - Returns true if value is a power of two, otherwise false.

Source: src/math/pow2/IsValuePowerOfTwo.js#L7
Since: 3.0.0


Updated on