Merge pull request #1072 from knoxHuang/v1.2

add getAllTextures for CCTextureCache for fireball/issues/2836
This commit is contained in:
Jare Guo
2016-08-31 09:48:45 +08:00
committed by GitHub
2 changed files with 17 additions and 3 deletions
+2 -3
View File
@@ -151,7 +151,7 @@ var View = cc._Class.extend({
__resizeWithBrowserSize: false,
_isAdjustViewPort: true,
_targetDensityDPI: null,
_antiAliasEnabled: false,
_antiAliasEnabled: true,
/**
* Constructor of View
@@ -184,7 +184,6 @@ var View = cc._Class.extend({
_t._rpFixedWidth = new cc.ResolutionPolicy(_strategyer.EQUAL_TO_FRAME, _strategy.FIXED_WIDTH);
_t._targetDensityDPI = cc.macro.DENSITYDPI_HIGH;
_t.enableAntiAlias(true);
},
// Resize helper functions
@@ -469,7 +468,7 @@ var View = cc._Class.extend({
* !#en Returns whether the current enable on anti-alias
* !#zh 返回当前是否抗锯齿
* @method isAntiAliasEnabled
* @param {Boolean} enabled - Pass false to make pixel art sharp.
* @return {Boolean}
*/
isAntiAliasEnabled: function () {
return this._antiAliasEnabled;
+15
View File
@@ -125,6 +125,21 @@ var textureCache = /** @lends cc.textureCache# */{
return this._textureColorsCache[key];
},
/**
* #en get all textures
* #zh 获取所有贴图
* @method getAllTextures
* @return {Texture2D[]}
*/
getAllTextures: function () {
var texs = [];
for (var key in this._textures) {
var item = this._textures[key];
texs.push(item);
}
return texs;
},
/**
* <p>Purges the dictionary of loaded textures. <br />
* Call this method if you receive the "Memory Warning" <br />