Class: Utils

Phaser. Utils

new Utils()

Source:

Classes

Debug

Methods

<static> extend(deep, target) → {object}

This is a slightly modified version of http://api.jquery.com/jQuery.extend/

Parameters:
Name Type Description
deep boolean

Perform a deep copy?

target object

The target object to copy to.

Source:
Returns:

The extended object.

Type
object

<static> isPlainObject(obj) → {boolean}

This is a slightly modified version of jQuery.isPlainObject. A plain object is an object whose internal class property is [object Object].

Parameters:
Name Type Description
obj object

The object to inspect.

Source:
Returns:
  • true if the object is plain, otherwise false.
Type
boolean

<static> pad(str, len, pad, dir) → {string}

Javascript string pad http://www.webtoolkit.info/. pad = the string to pad it out with (defaults to a space) dir = 1 (left), 2 (right), 3 (both)

Parameters:
Name Type Argument Default Description
str string

The target string.

len number

The number of characters to be added.

pad number

The string to pad it out with (defaults to a space).

dir number <optional>
3

The direction dir = 1 (left), 2 (right), 3 (both).

Source:
Returns:

The padded string

Type
string

<static> parseDimension(size, dimension) → {number}

Get a unit dimension from a string.

Parameters:
Name Type Description
size string | number

The size to parse.

dimension number

The window dimension to check.

Source:
Returns:

The parsed dimension.

Type
number

<static> shuffle(array) → {array}

A standard Fisher-Yates Array shuffle implementation.

Parameters:
Name Type Description
array array

The array to shuffle.

Source:
Returns:

The shuffled array.

Type
array
Phaser Copyright © 2012-2014 Photon Storm Ltd.
Documentation generated by JSDoc 3.3.0-dev on Fri Apr 11 2014 13:25:24 GMT+0100 (BST) using the DocStrap template.