mirror of
https://github.com/cocos/cocos4.git
synced 2026-12-01 15:52:40 +08:00
Merge pull request #1072 from knoxHuang/v1.2
add getAllTextures for CCTextureCache for fireball/issues/2836
This commit is contained in:
@@ -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;
|
||||
|
||||
@@ -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 />
|
||||
|
||||
Reference in New Issue
Block a user