This commit is contained in:
Richard Davey 2018-06-08 16:18:44 +01:00
commit ed97d1594a
4 changed files with 46 additions and 41 deletions

View file

@ -9,7 +9,9 @@ var Utils = require('../../renderer/webgl/Utils');
/**
* @classdesc
* [description]
* A 2D point light.
*
* Add these to a scene using the ForwardDiffuseLightPipeline for lighting effects, or just to represent a point light.
*
* @class Light
* @memberOf Phaser.GameObjects
@ -19,9 +21,9 @@ var Utils = require('../../renderer/webgl/Utils');
* @param {number} x - The horizontal position of the light.
* @param {number} y - The vertical position of the light.
* @param {number} radius - The radius of the light.
* @param {number} r - The red color. A value between 0 and 1.
* @param {number} g - The green color. A value between 0 and 1.
* @param {number} b - The blue color. A value between 0 and 1.
* @param {number} r - The red color of the light. A value between 0 and 1.
* @param {number} g - The green color of the light. A value between 0 and 1.
* @param {number} b - The blue color of the light. A value between 0 and 1.
* @param {number} intensity - The intensity of the light.
*/
var Light = new Class({
@ -31,7 +33,7 @@ var Light = new Class({
function Light (x, y, radius, r, g, b, intensity)
{
/**
* [description]
* The horizontal position of the light.
*
* @name Phaser.GameObjects.Light#x
* @type {number}
@ -40,7 +42,7 @@ var Light = new Class({
this.x = x;
/**
* [description]
* The vertical position of the light.
*
* @name Phaser.GameObjects.Light#y
* @type {number}
@ -49,7 +51,7 @@ var Light = new Class({
this.y = y;
/**
* [description]
* The radius of the light.
*
* @name Phaser.GameObjects.Light#radius
* @type {number}
@ -58,7 +60,7 @@ var Light = new Class({
this.radius = radius;
/**
* [description]
* The red color of the light. A value between 0 and 1.
*
* @name Phaser.GameObjects.Light#r
* @type {number}
@ -67,7 +69,7 @@ var Light = new Class({
this.r = r;
/**
* [description]
* The green color of the light. A value between 0 and 1.
*
* @name Phaser.GameObjects.Light#g
* @type {number}
@ -76,7 +78,7 @@ var Light = new Class({
this.g = g;
/**
* [description]
* The blue color of the light. A value between 0 and 1.
*
* @name Phaser.GameObjects.Light#b
* @type {number}
@ -85,7 +87,7 @@ var Light = new Class({
this.b = b;
/**
* [description]
* The intensity of the light.
*
* @name Phaser.GameObjects.Light#intensity
* @type {number}
@ -94,7 +96,7 @@ var Light = new Class({
this.intensity = intensity;
/**
* [description]
* The horizontal scroll factor of the light.
*
* @name Phaser.GameObjects.Light#scrollFactorX
* @type {number}
@ -103,7 +105,7 @@ var Light = new Class({
this.scrollFactorX = 1.0;
/**
* [description]
* The vertical scroll factor of the light.
*
* @name Phaser.GameObjects.Light#scrollFactorY
* @type {number}
@ -113,7 +115,10 @@ var Light = new Class({
},
/**
* [description]
* Set the properties of the light.
*
* Sets both horizontal and vertical scroll factor to 1. Use {@link Phaser.GameObjects.Light#setScrollFactor} to set
* the scroll factor.
*
* @method Phaser.GameObjects.Light#set
* @since 3.0.0
@ -148,7 +153,7 @@ var Light = new Class({
},
/**
* [description]
* Set the scroll factor of the light.
*
* @method Phaser.GameObjects.Light#setScrollFactor
* @since 3.0.0
@ -170,7 +175,7 @@ var Light = new Class({
},
/**
* [description]
* Set the color of the light from a single integer RGB value.
*
* @method Phaser.GameObjects.Light#setColor
* @since 3.0.0
@ -182,21 +187,21 @@ var Light = new Class({
setColor: function (rgb)
{
var color = Utils.getFloatsFromUintRGB(rgb);
this.r = color[0];
this.g = color[1];
this.b = color[2];
return this;
},
/**
* [description]
* Set the intensity of the light.
*
* @method Phaser.GameObjects.Light#setIntensity
* @since 3.0.0
*
* @param {number} intensity - [description]
* @param {number} intensity - The intensity of the light.
*
* @return {Phaser.GameObjects.Light} This Light object.
*/
@ -208,7 +213,7 @@ var Light = new Class({
},
/**
* [description]
* Set the position of the light.
*
* @method Phaser.GameObjects.Light#setPosition
* @since 3.0.0
@ -227,12 +232,12 @@ var Light = new Class({
},
/**
* [description]
* Set the radius of the light.
*
* @method Phaser.GameObjects.Light#setRadius
* @since 3.0.0
*
* @param {number} radius - [description]
* @param {number} radius - The radius of the light.
*
* @return {Phaser.GameObjects.Light} This Light object.
*/

View file

@ -38,10 +38,10 @@ var MeshRender = require('./MeshRender');
* @param {Phaser.Scene} scene - The Scene to which this Game Object belongs. A Game Object can only belong to one Scene at a time.
* @param {number} x - The horizontal position of this Game Object in the world.
* @param {number} y - The vertical position of this Game Object in the world.
* @param {float[]} vertices - An array containing the vertices data for this Mesh.
* @param {float[]} uv - An array containing the uv data for this Mesh.
* @param {float[]} colors - An array containing the color data for this Mesh.
* @param {float[]} alphas - An array containing the alpha data for this Mesh.
* @param {number[]} vertices - An array containing the vertices data for this Mesh.
* @param {number[]} uv - An array containing the uv data for this Mesh.
* @param {number[]} colors - An array containing the color data for this Mesh.
* @param {number[]} alphas - An array containing the alpha data for this Mesh.
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.
* @param {(string|integer)} [frame] - An optional frame from the Texture this Game Object is rendering with.
*/
@ -115,7 +115,7 @@ var Mesh = new Class({
}
/**
* [description]
* An array containing the vertices data for this Mesh.
*
* @name Phaser.GameObjects.Mesh#vertices
* @type {Float32Array}
@ -124,7 +124,7 @@ var Mesh = new Class({
this.vertices = new Float32Array(vertices);
/**
* [description]
* An array containing the uv data for this Mesh.
*
* @name Phaser.GameObjects.Mesh#uv
* @type {Float32Array}
@ -133,7 +133,7 @@ var Mesh = new Class({
this.uv = new Float32Array(uv);
/**
* [description]
* An array containing the color data for this Mesh.
*
* @name Phaser.GameObjects.Mesh#colors
* @type {Uint32Array}
@ -142,7 +142,7 @@ var Mesh = new Class({
this.colors = new Uint32Array(colors);
/**
* [description]
* An array containing the alpha data for this Mesh.
*
* @name Phaser.GameObjects.Mesh#alphas
* @type {Float32Array}

View file

@ -24,7 +24,7 @@ var Mesh = require('../mesh/Mesh');
* @webglOnly
* @since 3.0.0
*
* @param {Phaser.Scene} scene - [description]
* @param {Phaser.Scene} scene - The Scene to which this Quad belongs.
* @param {number} x - The horizontal position of this Game Object in the world.
* @param {number} y - The vertical position of this Game Object in the world.
* @param {string} texture - The key of the Texture this Game Object will use to render with, as stored in the Texture Manager.

View file

@ -79,7 +79,7 @@ var Sprite = new Class({
GameObject.call(this, scene, 'Sprite');
/**
* [description]
* The Animation Controller of this Sprite.
*
* @name Phaser.GameObjects.Sprite#anims
* @type {Phaser.GameObjects.Components.Animation}
@ -95,14 +95,14 @@ var Sprite = new Class({
},
/**
* [description]
* Update this Sprite's animations.
*
* @method Phaser.GameObjects.Sprite#preUpdate
* @protected
* @since 3.0.0
*
* @param {number} time - [description]
* @param {number} delta - [description]
* @param {number} time - The current timestamp.
* @param {number} delta - The delta time, in ms, elapsed since the last frame.
*/
preUpdate: function (time, delta)
{
@ -110,14 +110,14 @@ var Sprite = new Class({
},
/**
* [description]
* Start playing the given animation.
*
* @method Phaser.GameObjects.Sprite#play
* @since 3.0.0
*
* @param {string} key - [description]
* @param {boolean} [ignoreIfPlaying=false] - [description]
* @param {integer} [startFrame=0] - [description]
* @param {string} key - The string-based key of the animation to play.
* @param {boolean} [ignoreIfPlaying=false] - If an animation is already playing then ignore this call.
* @param {integer} [startFrame=0] - Optionally start the animation playing from this frame index.
*
* @return {Phaser.GameObjects.Sprite} This Game Object.
*/
@ -129,7 +129,7 @@ var Sprite = new Class({
},
/**
* [description]
* Build a JSON representation of this Sprite.
*
* @method Phaser.GameObjects.Sprite#toJSON
* @since 3.0.0