mirror of
https://github.com/photonstorm/phaser
synced 2025-02-16 14:08:28 +00:00
Fix "object" types on Camera and GameObjecs
This commit is contained in:
parent
28206e872f
commit
5a518f2e5f
12 changed files with 138 additions and 62 deletions
|
@ -25,7 +25,11 @@ var Vector2 = require('../../math/Vector2');
|
|||
* @property {number} scrollX - The horizontal scroll of camera
|
||||
* @property {number} scrollY - The vertical scroll of camera
|
||||
* @property {string} backgroundColor - The background color of camera
|
||||
* @property {object} [bounds] - The bounds of camera // TODO 19/03/2018 Create BoundsObject ({x:number,y:number,width:number,height:number})
|
||||
* @property {object} [bounds] - The bounds of camera
|
||||
* @property {number} [bounds.x] - The horizontal position of bounds of camera
|
||||
* @property {number} [bounds.y] - The vertical position of bounds of camera
|
||||
* @property {number} [bounds.width] - The width of the bounds of camera
|
||||
* @property {number} [bounds.height] - The height of the bounds of camera
|
||||
*/
|
||||
|
||||
/**
|
||||
|
|
|
@ -24,6 +24,13 @@ var billboardMatrix = new Matrix4();
|
|||
|
||||
// @author attribute https://github.com/mattdesl/cam3d/wiki
|
||||
|
||||
/**
|
||||
* @typedef {object} RayDef
|
||||
*
|
||||
* @property {Phaser.Math.Vector3} origin - [description]
|
||||
* @property {Phaser.Math.Vector3} direction - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* [description]
|
||||
|
@ -174,13 +181,6 @@ var Camera = new Class({
|
|||
*/
|
||||
this.far = 100;
|
||||
|
||||
/**
|
||||
* @typedef {object} RayDef
|
||||
*
|
||||
* @property {Phaser.Math.Vector3} origin - [description]
|
||||
* @property {Phaser.Math.Vector3} direction - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* [description]
|
||||
*
|
||||
|
|
|
@ -8,6 +8,26 @@ var BlendModes = require('../renderer/BlendModes');
|
|||
var GetAdvancedValue = require('../utils/object/GetAdvancedValue');
|
||||
var ScaleModes = require('../renderer/ScaleModes');
|
||||
|
||||
/**
|
||||
* @typedef {object} GameObjectConfig
|
||||
*
|
||||
* @property {number} [x=0] - [description]
|
||||
* @property {number} [y=0] - [description]
|
||||
* @property {number} [depth=0] - [description]
|
||||
* @property {boolean} [flipX=false] - [description]
|
||||
* @property {boolean} [flipY=false] - [description]
|
||||
* @property {?(number|object)} [scale=null] - [description]
|
||||
* @property {?(number|object)} [scrollFactor=null] - [description]
|
||||
* @property {number} [rotation=0] - [description]
|
||||
* @property {?number} [angle=null] - [description]
|
||||
* @property {number} [alpha=1] - [description]
|
||||
* @property {?(number|object)} [origin=null] - [description]
|
||||
* @property {number} [scaleMode=ScaleModes.DEFAULT] - [description]
|
||||
* @property {number} [blendMode=BlendModes.DEFAULT] - [description]
|
||||
* @property {boolean} [visible=true] - [description]
|
||||
* @property {boolean} [add=true] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Builds a Game Object using the provided configuration object.
|
||||
*
|
||||
|
@ -16,7 +36,7 @@ var ScaleModes = require('../renderer/ScaleModes');
|
|||
*
|
||||
* @param {Phaser.Scene} scene - [description]
|
||||
* @param {Phaser.GameObjects.GameObject} gameObject - [description]
|
||||
* @param {object} config - [description]
|
||||
* @param {GameObjectConfig} config - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} The built Game Object.
|
||||
*/
|
||||
|
|
|
@ -125,7 +125,7 @@ var DynamicBitmapText = new Class({
|
|||
* [description]
|
||||
*
|
||||
* @name Phaser.GameObjects.DynamicBitmapText#_bounds
|
||||
* @type {object}
|
||||
* @type {TextBounds}
|
||||
* @private
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -360,7 +360,7 @@ var DynamicBitmapText = new Class({
|
|||
* @method Phaser.GameObjects.DynamicBitmapText#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {object} [description]
|
||||
* @return {JSONGameObject.<JSONBitmapText>} [description]
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
|
@ -9,6 +9,16 @@ var BuildGameObject = require('../../BuildGameObject');
|
|||
var GameObjectCreator = require('../../GameObjectCreator');
|
||||
var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
|
||||
|
||||
/**
|
||||
* @typedef {object} BitmapTextConfig
|
||||
* @extends GameObjectConfig
|
||||
*
|
||||
* @property {string} [font=''] - [description]
|
||||
* @property {string} [text=''] - [description]
|
||||
* @property {(number|false)} [size=false] - [description]
|
||||
* @property {string} [align=''] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new Dynamic Bitmap Text Game Object and returns it.
|
||||
*
|
||||
|
@ -16,8 +26,8 @@ var GetAdvancedValue = require('../../../utils/object/GetAdvancedValue');
|
|||
*
|
||||
* @method Phaser.GameObjects.GameObjectCreator#dynamicBitmapText
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} config - [description]
|
||||
*²
|
||||
* @param {BitmapTextConfig} config - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.DynamicBitmapText} The Game Object that was created.
|
||||
*/
|
||||
|
|
|
@ -15,16 +15,24 @@ var Render = require('./BitmapTextRender');
|
|||
/**
|
||||
* @typedef {object} TextBounds
|
||||
*
|
||||
* @param {object} local - [description]
|
||||
* @param {number} local.x - [description]
|
||||
* @param {number} local.y - [description]
|
||||
* @param {number} local.width - [description]
|
||||
* @param {number} local.height - [description]
|
||||
* @param {object} global - [description]
|
||||
* @param {number} global.x - [description]
|
||||
* @param {number} global.y - [description]
|
||||
* @param {number} global.width - [description]
|
||||
* @param {number} global.height - [description]
|
||||
* @property {object} local - [description]
|
||||
* @property {number} local.x - [description]
|
||||
* @property {number} local.y - [description]
|
||||
* @property {number} local.width - [description]
|
||||
* @property {number} local.height - [description]
|
||||
* @property {object} global - [description]
|
||||
* @property {number} global.x - [description]
|
||||
* @property {number} global.y - [description]
|
||||
* @property {number} global.width - [description]
|
||||
* @property {number} global.height - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @typedef {object} JSONBitmapText
|
||||
*
|
||||
* @property {string} font - [description]
|
||||
* @property {string} text - [description]
|
||||
* @property {number} fontSize - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
|
@ -130,7 +138,7 @@ var BitmapText = new Class({
|
|||
* [description]
|
||||
*
|
||||
* @name Phaser.GameObjects.BitmapText#_bounds
|
||||
* @type {object}
|
||||
* @type {TextBounds}
|
||||
* @private
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -248,7 +256,7 @@ var BitmapText = new Class({
|
|||
* @method Phaser.GameObjects.BitmapText#toJSON
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @return {JSONGameObject} [description]
|
||||
* @return {JSONGameObject.<JSONBitmapText>} [description]
|
||||
*/
|
||||
toJSON: function ()
|
||||
{
|
||||
|
|
|
@ -18,7 +18,7 @@ var GetValue = require('../../../utils/object/GetValue');
|
|||
* @method Phaser.GameObjects.GameObjectCreator#bitmapText
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} config - [description]
|
||||
* @param {BitmapTextConfig} config - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.BitmapText} The Game Object that was created.
|
||||
*/
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
|
||||
/**
|
||||
* @typedef {object} JSONGameObject
|
||||
* @template DATA
|
||||
*
|
||||
* @property {string} name - The name of this Game Object.
|
||||
* @property {string} type - A textual representation of this Game Object, i.e. `sprite`.
|
||||
|
@ -26,7 +27,7 @@
|
|||
* @property {(integer|string)} blendMode - Sets the Blend Mode being used by this Game Object.
|
||||
* @property {string} textureKey - The texture key of this Game Object.
|
||||
* @property {string} frameKey - The frame key of this Game Object.
|
||||
* @property {object} data - The data of this Game Object.
|
||||
* @property {DATA} data - The data of this Game Object.
|
||||
*/
|
||||
|
||||
// Default Game Object JSON export
|
||||
|
|
|
@ -13,7 +13,7 @@ var _FLAG = 4; // 0100
|
|||
|
||||
/**
|
||||
* Provides methods used for getting and setting the position, scale and rotation of a Game Object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -27,7 +27,7 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The x position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#x
|
||||
* @type {number}
|
||||
* @default 0
|
||||
|
@ -37,7 +37,7 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The y position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#y
|
||||
* @type {number}
|
||||
* @default 0
|
||||
|
@ -48,7 +48,7 @@ var Transform = {
|
|||
/**
|
||||
* The z position of this Game Object.
|
||||
* Note: Do not use this value to set the z-index, instead see the `depth` property.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#z
|
||||
* @type {number}
|
||||
* @default 0
|
||||
|
@ -58,7 +58,7 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The w position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#w
|
||||
* @type {number}
|
||||
* @default 0
|
||||
|
@ -68,7 +68,7 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The horizontal scale of this Game Object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#scaleX
|
||||
* @type {number}
|
||||
* @default 1
|
||||
|
@ -99,7 +99,7 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The vertical scale of this Game Object.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#scaleY
|
||||
* @type {number}
|
||||
* @default 1
|
||||
|
@ -130,11 +130,11 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The angle of this Game Object as expressed in degrees.
|
||||
*
|
||||
*
|
||||
* Where 0 is to the right, 90 is down, 180 is left.
|
||||
*
|
||||
*
|
||||
* If you prefer to work in radians, see the `rotation` property instead.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#angle
|
||||
* @type {integer}
|
||||
* @default 0
|
||||
|
@ -156,9 +156,9 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* The angle of this Game Object in radians.
|
||||
*
|
||||
*
|
||||
* If you prefer to work in degrees, see the `angle` property instead.
|
||||
*
|
||||
*
|
||||
* @name Phaser.GameObjects.Components.Transform#rotation
|
||||
* @type {number}
|
||||
* @default 1
|
||||
|
@ -180,7 +180,7 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setPosition
|
||||
* @since 3.0.0
|
||||
*
|
||||
|
@ -188,7 +188,7 @@ var Transform = {
|
|||
* @param {number} [y] - The y position of this Game Object. If not set it will use the `x` value.
|
||||
* @param {number} [z=0] - The z position of this Game Object.
|
||||
* @param {number} [w=0] - The w position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setPosition: function (x, y, z, w)
|
||||
|
@ -208,12 +208,12 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the rotation of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setRotation
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [radians=0] - The rotation of this Game Object, in radians.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setRotation: function (radians)
|
||||
|
@ -227,12 +227,12 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the angle of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setAngle
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [degrees=0] - The rotation of this Game Object, in degrees.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setAngle: function (degrees)
|
||||
|
@ -246,13 +246,13 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the scale of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setScale
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} x - The horizontal scale of this Game Object.
|
||||
* @param {number} [y] - The vertical scale of this Game Object. If not set it will use the `x` value.
|
||||
*
|
||||
* @param {number} [y=x] - The vertical scale of this Game Object. If not set it will use the `x` value.
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setScale: function (x, y)
|
||||
|
@ -268,12 +268,12 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the x position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setX
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [value=0] - The x position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setX: function (value)
|
||||
|
@ -287,12 +287,12 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the y position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setY
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [value=0] - The y position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setY: function (value)
|
||||
|
@ -306,12 +306,12 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the z position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setZ
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [value=0] - The z position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setZ: function (value)
|
||||
|
@ -325,12 +325,12 @@ var Transform = {
|
|||
|
||||
/**
|
||||
* Sets the w position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @method Phaser.GameObjects.Components.Transform#setW
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {number} [value=0] - The w position of this Game Object.
|
||||
*
|
||||
*
|
||||
* @return {Phaser.GameObjects.GameObject} This Game Object instance.
|
||||
*/
|
||||
setW: function (value)
|
||||
|
|
|
@ -12,6 +12,18 @@ var Sprite = require('../sprite/Sprite');
|
|||
var TWEEN_CONST = require('../../tweens/tween/const');
|
||||
var Vector2 = require('../../math/Vector2');
|
||||
|
||||
/**
|
||||
* @typedef {object} PathConfig
|
||||
*
|
||||
* @property {number} duration - [description]
|
||||
* @property {number} from - [description]
|
||||
* @property {number} to - [description]
|
||||
* @property {boolean} [positionOnPath=false] - [description]
|
||||
* @property {boolean} [rotateToPath=false] - [description]
|
||||
* @property {number} [rotationOffset=0] - [description]
|
||||
* @property {boolean} [verticalAdjust=false] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* @classdesc
|
||||
* A PathFollower Game Object.
|
||||
|
@ -112,7 +124,7 @@ var PathFollower = new Class({
|
|||
* [description]
|
||||
*
|
||||
* @name Phaser.GameObjects.PathFollower#pathTween
|
||||
* @type {null}
|
||||
* @type {Phaser.Tweens.Tween}
|
||||
* @since 3.0.0
|
||||
*/
|
||||
this.pathTween;
|
||||
|
@ -121,7 +133,7 @@ var PathFollower = new Class({
|
|||
* [description]
|
||||
*
|
||||
* @name Phaser.GameObjects.PathFollower#pathConfig
|
||||
* @type {?object}
|
||||
* @type {?PathConfig}
|
||||
* @default null
|
||||
* @since 3.0.0
|
||||
*/
|
||||
|
@ -145,7 +157,7 @@ var PathFollower = new Class({
|
|||
* @since 3.0.0
|
||||
*
|
||||
* @param {Phaser.Curves.Path} path - The Path this PathFollower is following. It can only follow one Path at a time.
|
||||
* @param {object} config - [description]
|
||||
* @param {PathConfig} [config] - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.PathFollower} This Game Object.
|
||||
*/
|
||||
|
@ -218,7 +230,7 @@ var PathFollower = new Class({
|
|||
* @method Phaser.GameObjects.PathFollower#start
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} config - [description]
|
||||
* @param {(number|PathConfig)} [config={}] - [description]
|
||||
* @param {number} [startAt=0] - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.PathFollower} This Game Object.
|
||||
|
|
|
@ -9,6 +9,15 @@ var GameObjectCreator = require('../GameObjectCreator');
|
|||
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||||
var RenderTexture = require('./RenderTexture');
|
||||
|
||||
/**
|
||||
* @typedef {object} RenderTextureConfig
|
||||
*
|
||||
* @property {number} [x=0] - [description]
|
||||
* @property {number} [y=0] - [description]
|
||||
* @property {number} [width=32] - [description]
|
||||
* @property {number} [height=32] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new Render Texture Game Object and returns it.
|
||||
*
|
||||
|
@ -17,7 +26,7 @@ var RenderTexture = require('./RenderTexture');
|
|||
* @method Phaser.GameObjects.GameObjectCreator#renderTexture
|
||||
* @since 3.2.0
|
||||
*
|
||||
* @param {object} config - [description]
|
||||
* @param {RenderTextureConfig} config - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.RenderTexture} The Game Object that was created.
|
||||
*/
|
||||
|
|
|
@ -9,6 +9,18 @@ var GameObjectCreator = require('../GameObjectCreator');
|
|||
var GetAdvancedValue = require('../../utils/object/GetAdvancedValue');
|
||||
var TileSprite = require('./TileSprite');
|
||||
|
||||
/**
|
||||
* @typedef {object} TileSprite
|
||||
* @extends GameObjectConfig
|
||||
*
|
||||
* @property {number} [x=0] - [description]
|
||||
* @property {number} [y=0] - [description]
|
||||
* @property {number} [width=512] - [description]
|
||||
* @property {number} [height=512] - [description]
|
||||
* @property {string} [key=''] - [description]
|
||||
* @property {string} [frame=''] - [description]
|
||||
*/
|
||||
|
||||
/**
|
||||
* Creates a new TileSprite Game Object and returns it.
|
||||
*
|
||||
|
@ -17,7 +29,7 @@ var TileSprite = require('./TileSprite');
|
|||
* @method Phaser.GameObjects.GameObjectCreator#tileSprite
|
||||
* @since 3.0.0
|
||||
*
|
||||
* @param {object} config - [description]
|
||||
* @param {TileSprite} config - [description]
|
||||
*
|
||||
* @return {Phaser.GameObjects.TileSprite} The Game Object that was created.
|
||||
*/
|
||||
|
|
Loading…
Add table
Reference in a new issue