Video#changeSource()

changeSource(src, autoplay) → {Phaser.Video} On some mobile browsers you cannot play a video until the user has explicitly touched the video to allow it.Phaser handles this via the setTouchLock method. However if you have 3 different videos, maybe an "Intro", "Start" and "Game Over"split into three different Video objects, then you will need the user to touch-unlock every single one of them. You can avoid this by using just one Video object and simply changing the video source. Once a Video e

Video#addToWorld()

addToWorld(x, y, anchorX, anchorY, scaleX, scaleY) → {Phaser.Image} Creates a new Phaser.Image object, assigns this Video to be its texture, adds it to the world then returns it. Parameters Name Type Argument Default Description x number <optional> 0 The x coordinate to place the Image at. y number <optional> 0 The y coordinate to place the Image at. anchorX number <optional> 0 Set the x anchor point of the Image. A value between 0 and 1, where 0 is the top-l

Video#add()

add(object) → {Phaser.Video} Updates the given Display Objects so they use this Video as their texture.This will replace any texture they will currently have set. Parameters Name Type Description object Phaser.Sprite | Array.<Phaser.Sprite> | Phaser.Image | Array.<Phaser.Image> Either a single Sprite/Image or an Array of Sprites/Images. Returns Phaser.Video - This Video object for method chaining. Source code: gameobjects/Video.js (Line 804)

Utils.setProperty()

<static> setProperty(obj, prop) → {object} Sets an objects property by string. Parameters Name Type Description obj object The object to traverse prop string The property whose value will be changed Returns object - The object on which the property was set. Source code: utils/Utils.js (Line 60)

Utils.parseDimension()

<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. Returns number - The parsed dimension. Source code: utils/Utils.js (Line 118)

Utils.reverseString()

<static> reverseString(string) → {string} Takes the given string and reverses it, returning the reversed string.For example if given the string Atari 520ST it would return TS025 iratA. Parameters Name Type Description string string The string to be reversed. Returns string - The reversed string. Source code: utils/Utils.js (Line 13)

Utils.pad()

<static> pad(str, len, pad, dir) → {string} Takes the given string and pads it out, to the length required, using the characterspecified. For example if you need a string to be 6 characters long, you can call: pad('bob', 6, '-', 2) This would return: bob--- as it has padded it out to 6 characters, using the - on the right. You can also use it to pad numbers (they are always returned as strings): pad(512, 6, '0', 1) Would return: 000512 with the string padded to the left. If you don't s

Utils.mixin()

<static> mixin(from, to) → {object} Mixes the source object into the destination object, returning the newly modified destination object.Based on original code by @mudcube Parameters Name Type Description from object The object to copy (the source object). to object The object to copy to (the destination object). Returns object - The modified destination object. Source code: utils/Utils.js (Line 390)

Utils.mixinPrototype()

<static> mixinPrototype(target, mixin, replace) Mixes in an existing mixin object with the target. Values in the mixin that have either get or set functions are created as properties via definePropertyexcept if they also define a clone method - if a clone method is defined that is called instead andthe result is assigned directly. Parameters Name Type Argument Default Description target object The target object to receive the new functions. mixin object The object to copy

Utils.getProperty()

<static> getProperty(obj, prop) → {*} Gets an objects property by string. Parameters Name Type Description obj object The object to traverse. prop string The property whose value will be returned. Returns * - the value of the property or null if property isn't found . Source code: utils/Utils.js (Line 27)