phaser/src/pixi/Pixi.js

112 lines
2.4 KiB
JavaScript
Raw Normal View History

/**
* @author Mat Groves http://matgroves.com/ @Doormat23
*/
/**
2014-11-15 19:53:38 +00:00
* The [pixi.js](http://www.pixijs.com/) module/namespace.
*
* @module PIXI
*/
2014-11-15 19:53:38 +00:00
/**
* Namespace-class for [pixi.js](http://www.pixijs.com/).
*
* Contains assorted static properties and enumerations.
*
* @class PIXI
* @static
*/
var PIXI = PIXI || {};
2014-02-06 00:19:46 +00:00
2014-11-15 19:53:38 +00:00
/**
* @property {Number} WEBGL_RENDERER
* @protected
* @static
*/
2014-02-06 00:19:46 +00:00
PIXI.WEBGL_RENDERER = 0;
2014-11-15 19:53:38 +00:00
/**
* @property {Number} CANVAS_RENDERER
* @protected
* @static
*/
2014-02-06 00:19:46 +00:00
PIXI.CANVAS_RENDERER = 1;
2014-11-15 19:53:38 +00:00
/**
* Version of pixi that is loaded.
* @property {String} VERSION
* @static
*/
2015-03-23 08:13:17 +00:00
PIXI.VERSION = "v2.2.8";
2014-02-06 00:19:46 +00:00
// used to create uids for various pixi objects..
PIXI._UID = 0;
if (typeof(Float32Array) != 'undefined')
{
PIXI.Float32Array = Float32Array;
PIXI.Uint16Array = Uint16Array;
2014-12-02 11:01:57 +00:00
// Uint32Array and ArrayBuffer only used by WebGL renderer
// We can suppose that if WebGL is supported then typed arrays are supported too
// as they predate WebGL support for all browsers:
// see typed arrays support: http://caniuse.com/#search=TypedArrays
// see WebGL support: http://caniuse.com/#search=WebGL
PIXI.Uint32Array = Uint32Array;
PIXI.ArrayBuffer = ArrayBuffer;
}
else
{
PIXI.Float32Array = Array;
PIXI.Uint16Array = Array;
}
2014-11-15 19:53:38 +00:00
/**
* @property {Number} PI_2
* @static
*/
2014-10-10 19:36:04 +00:00
PIXI.PI_2 = Math.PI * 2;
2014-11-15 19:53:38 +00:00
/**
* @property {Number} RAD_TO_DEG
* @static
*/
PIXI.RAD_TO_DEG = 180 / Math.PI;
2014-11-15 19:53:38 +00:00
/**
* @property {Number} DEG_TO_RAD
* @static
*/
PIXI.DEG_TO_RAD = Math.PI / 180;
2014-11-15 19:53:38 +00:00
/**
* @property {String} RETINA_PREFIX
* @protected
* @static
*/
2014-10-10 19:36:04 +00:00
PIXI.RETINA_PREFIX = "@2x";
2014-07-03 09:49:58 +00:00
2014-11-15 19:53:38 +00:00
/**
* The default render options if none are supplied to
* {{#crossLink "WebGLRenderer"}}{{/crossLink}} or {{#crossLink "CanvasRenderer"}}{{/crossLink}}.
*
* @property {Object} defaultRenderOptions
* @property {Object} defaultRenderOptions.view=null
* @property {Boolean} defaultRenderOptions.transparent=false
* @property {Boolean} defaultRenderOptions.antialias=false
* @property {Boolean} defaultRenderOptions.preserveDrawingBuffer=false
* @property {Number} defaultRenderOptions.resolution=1
* @property {Boolean} defaultRenderOptions.clearBeforeRender=true
* @property {Boolean} defaultRenderOptions.autoResize=false
* @static
*/
2014-10-10 19:36:04 +00:00
PIXI.defaultRenderOptions = {
view: null,
transparent: false,
antialias: false,
preserveDrawingBuffer: false,
resolution: 1,
clearBeforeRender: true,
autoResize: false
2014-07-03 09:49:58 +00:00
};