/**************************************************************************** Copyright (c) 2010-2012 cocos2d-x.org Copyright (c) 2008-2010 Ricardo Quesada Copyright (c) 2011 Zynga Inc. http://www.cocos2d-x.org Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. ****************************************************************************/ /** *

* The current version of Cocos2d-html5 being used.
* Please DO NOT remove this String, it is an important flag for bug tracking.
* If you post a bug to forum, please attach this flag. *

* @constant * @type String */ cc.ENGINE_VERSION = "Cocos2d-html5-v2.2.3"; /** *

* If enabled, the texture coordinates will be calculated by using this formula:
* - texCoord.left = (rect.origin.x*2+1) / (texture.wide*2);
* - texCoord.right = texCoord.left + (rect.size.width*2-2)/(texture.wide*2);
*
* The same for bottom and top.
*
* This formula prevents artifacts by using 99% of the texture.
* The "correct" way to prevent artifacts is by using the spritesheet-artifact-fixer.py or a similar tool.
*
* Affected nodes:
* - cc.Sprite / cc.SpriteBatchNode and subclasses: cc.LabelBMFont, cc.TMXTiledMap
* - cc.LabelAtlas
* - cc.QuadParticleSystem
* - cc.TileMap
*
* To enabled set it to 1. Disabled by default. *

* @constant * @type Number */ cc.FIX_ARTIFACTS_BY_STRECHING_TEXEL = 0; /** * Position of the FPS (Default: 0,0 (bottom-left corner)) * @constant * @type cc.Point */ cc.DIRECTOR_STATS_POSITION = cc.p(0, 0); /** *

* Senconds between FPS updates.
* 0.5 seconds, means that the FPS number will be updated every 0.5 seconds.
* Having a bigger number means a more reliable FPS
*
* Default value: 0.1f
*

* @constant * @type Number */ cc.DIRECTOR_FPS_INTERVAL = 0.5; /** *

* If enabled, the cc.Node objects (cc.Sprite, cc.Label,etc) will be able to render in subpixels.
* If disabled, integer pixels will be used.
*
* To enable set it to 1. Enabled by default. *

* @constant * @type Number */ cc.COCOSNODE_RENDER_SUBPIXEL = 1; /** *

* If enabled, the cc.Sprite objects rendered with cc.SpriteBatchNode will be able to render in subpixels.
* If disabled, integer pixels will be used.
*
* To enable set it to 1. Enabled by default. *

* @constant * @type Number */ cc.SPRITEBATCHNODE_RENDER_SUBPIXEL = 1; /** *

* If most of your imamges have pre-multiplied alpha, set it to 1 (if you are going to use .PNG/.JPG file images).
* Only set to 0 if ALL your images by-pass Apple UIImage loading system (eg: if you use libpng or PVR images)
*
* To enable set it to a value different than 0. Enabled by default. *

* @constant * @type Number */ cc.OPTIMIZE_BLEND_FUNC_FOR_PREMULTIPLIED_ALPHA = 0; /** *

* Use GL_TRIANGLE_STRIP instead of GL_TRIANGLES when rendering the texture atlas.
* It seems it is the recommend way, but it is much slower, so, enable it at your own risk
*
* To enable set it to a value different than 0. Disabled by default. *

* @constant * @type Number */ cc.TEXTURE_ATLAS_USE_TRIANGLE_STRIP = 0; /** *

* By default, cc.TextureAtlas (used by many cocos2d classes) will use VAO (Vertex Array Objects).
* Apple recommends its usage but they might consume a lot of memory, specially if you use many of them.
* So for certain cases, where you might need hundreds of VAO objects, it might be a good idea to disable it.
*
* To disable it set it to 0. disable by default.(Not Supported on WebGL)
*

* @constant * @type Number */ cc.TEXTURE_ATLAS_USE_VAO = 0; /** *

* If enabled, NPOT textures will be used where available. Only 3rd gen (and newer) devices support NPOT textures.
* NPOT textures have the following limitations:
* - They can't have mipmaps
* - They only accept GL_CLAMP_TO_EDGE in GL_TEXTURE_WRAP_{S,T}
*
* To enable set it to a value different than 0. Disabled by default.
*
* This value governs only the PNG, GIF, BMP, images.
* This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value. *

* @constant * @type Number * @deprecated This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it. */ cc.TEXTURE_NPOT_SUPPORT = 0; /** *

* If enabled, cocos2d supports retina display.
* For performance reasons, it's recommended disable it in games without retina display support, like iPad only games.
*
* To enable set it to 1. Use 0 to disable it. Enabled by default.
*
* This value governs only the PNG, GIF, BMP, images.
* This value DOES NOT govern the PVR (PVR.GZ, PVR.CCZ) files. If NPOT PVR is loaded, then it will create an NPOT texture ignoring this value. *

* @constant * @type Number * @deprecated This value will be removed in 1.1 and NPOT textures will be loaded by default if the device supports it. */ cc.RETINA_DISPLAY_SUPPORT = 1; /** *

* It's the suffix that will be appended to the files in order to load "retina display" images.
*
* On an iPhone4 with Retina Display support enabled, the file @"sprite-hd.png" will be loaded instead of @"sprite.png".
* If the file doesn't exist it will use the non-retina display image.
*
* Platforms: Only used on Retina Display devices like iPhone 4. *

* @constant * @type String */ cc.RETINA_DISPLAY_FILENAME_SUFFIX = "-hd"; /** *

* If enabled, it will use LA88 (Luminance Alpha 16-bit textures) for CCLabelTTF objects.
* If it is disabled, it will use A8 (Alpha 8-bit textures).
* LA88 textures are 6% faster than A8 textures, but they will consume 2x memory.
*
* This feature is enabled by default. *

* @constant * @type Number */ cc.USE_LA88_LABELS = 1; /** *

* If enabled, all subclasses of cc.Sprite will draw a bounding box
* Useful for debugging purposes only. It is recommened to leave it disabled.
*
* To enable set it to a value different than 0. Disabled by default:
* 0 -- disabled
* 1 -- draw bounding box
* 2 -- draw texture box *

* @constant * @type Number */ cc.SPRITE_DEBUG_DRAW = 0; /** *

* If enabled, all subclasses of cc.Sprite that are rendered using an cc.SpriteBatchNode draw a bounding box.
* Useful for debugging purposes only. It is recommened to leave it disabled.
*
* To enable set it to a value different than 0. Disabled by default. *

* @constant * @type Number */ cc.SPRITEBATCHNODE_DEBUG_DRAW = 0; /** *

* If enabled, all subclasses of cc.LabelBMFont will draw a bounding box
* Useful for debugging purposes only. It is recommened to leave it disabled.
*
* To enable set it to a value different than 0. Disabled by default.
*

* @constant * @type Number */ cc.LABELBMFONT_DEBUG_DRAW = 0; /** *

* If enabled, all subclasses of cc.LabeltAtlas will draw a bounding box
* Useful for debugging purposes only. It is recommened to leave it disabled.
*
* To enable set it to a value different than 0. Disabled by default. *

* @constant * @type Number */ cc.LABELATLAS_DEBUG_DRAW = 0; /** * whether or not support retina display * @constant * @type Number */ cc.IS_RETINA_DISPLAY_SUPPORTED = 1; /** * default engine * @constant * @type String */ cc.DEFAULT_ENGINE = cc.ENGINE_VERSION + "-canvas"; /** * Runtime information * @deprecated Use "sys" instead. */ cc.config = { 'platform' : sys.platform }; /** * dump config info, but only in debug mode */ cc.dumpConfig = function() { for(var i in sys ) cc.log( i + " = " + sys[i] ); }; /** *

* If enabled, actions that alter the position property (eg: CCMoveBy, CCJumpBy, CCBezierBy, etc..) will be stacked.
* If you run 2 or more 'position' actions at the same time on a node, then end position will be the sum of all the positions.
* If disabled, only the last run action will take effect. *

* @constant * @type {number} */ cc.ENABLE_STACKABLE_ACTIONS = 1; /** *

* If enabled, cocos2d will maintain an OpenGL state cache internally to avoid unnecessary switches.
* In order to use them, you have to use the following functions, insead of the the GL ones:
* - ccGLUseProgram() instead of glUseProgram()
* - ccGLDeleteProgram() instead of glDeleteProgram()
* - ccGLBlendFunc() instead of glBlendFunc()
*
* If this functionality is disabled, then ccGLUseProgram(), ccGLDeleteProgram(), ccGLBlendFunc() will call the GL ones, without using the cache.
* It is recommened to enable whenever possible to improve speed.
* If you are migrating your code from GL ES 1.1, then keep it disabled. Once all your code works as expected, turn it on. *

* @constant * @type Number */ cc.ENABLE_GL_STATE_CACHE = 1;