2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
|
|
|
-- @module TextureCache
|
2014-03-20 10:21:28 +08:00
|
|
|
-- @extend Ref
|
2014-06-25 17:36:50 +08:00
|
|
|
-- @parent_module cc
|
2014-03-18 15:55:30 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Reload texture from the image file<br>
|
|
|
|
-- If the file image hasn't loaded before, load it.<br>
|
|
|
|
-- Otherwise the texture will be reloaded from the file image.<br>
|
|
|
|
-- The "filenName" parameter is the related/absolute path of the file image.<br>
|
|
|
|
-- Return true if the reloading is succeed, otherwise return false.
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] reloadTexture
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string fileName
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return bool#bool ret (return value: bool)
|
|
|
|
|
2014-05-26 09:58:46 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-05-26 09:58:46 +08:00
|
|
|
-- @function [parent=#TextureCache] unbindAllImageAsync
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-05-26 09:58:46 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Deletes a texture from the cache given a its key name<br>
|
|
|
|
-- since v0.99.4
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] removeTextureForKey
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string key
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Purges the dictionary of loaded textures.<br>
|
|
|
|
-- Call this method if you receive the "Memory Warning"<br>
|
|
|
|
-- In the short term: it will free some resources preventing your app from being killed<br>
|
|
|
|
-- In the medium term: it will allocate more resources<br>
|
|
|
|
-- In the long term: it will be the same
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] removeAllTextures
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- js NA<br>
|
|
|
|
-- lua NA
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] getDescription
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Output to CCLOG the current contents of this TextureCache<br>
|
|
|
|
-- This will attempt to calculate the size of each texture, and the total texture memory in use<br>
|
|
|
|
-- since v1.0
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] getCachedTextureInfo
|
|
|
|
-- @param self
|
|
|
|
-- @return string#string ret (return value: string)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-07-17 10:28:34 +08:00
|
|
|
-- @overload self, cc.Image, string
|
|
|
|
-- @overload self, string
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] addImage
|
|
|
|
-- @param self
|
|
|
|
-- @param #cc.Image image
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string key
|
2014-10-17 22:56:22 +08:00
|
|
|
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
2014-05-26 09:58:46 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-05-26 09:58:46 +08:00
|
|
|
-- @function [parent=#TextureCache] unbindImageAsync
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string filename
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-05-26 09:58:46 +08:00
|
|
|
|
2014-03-10 14:04:58 +08:00
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Returns an already created texture. Returns nil if the texture doesn't exist.<br>
|
|
|
|
-- since v0.99.5
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] getTextureForKey
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #string key
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @return Texture2D#Texture2D ret (return value: cc.Texture2D)
|
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Removes unused textures<br>
|
|
|
|
-- Textures that have a retain count of 1 will be deleted<br>
|
|
|
|
-- It is convenient to call this method after when starting a new Scene<br>
|
|
|
|
-- since v0.8
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] removeUnusedTextures
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- Deletes a texture from the cache given a texture
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] removeTexture
|
|
|
|
-- @param self
|
2014-09-02 13:45:07 +08:00
|
|
|
-- @param #cc.Texture2D texture
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
--
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] waitForQuit
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
--------------------------------
|
2014-09-02 13:45:07 +08:00
|
|
|
-- js ctor
|
2014-03-10 14:04:58 +08:00
|
|
|
-- @function [parent=#TextureCache] TextureCache
|
|
|
|
-- @param self
|
2015-01-21 17:33:26 +08:00
|
|
|
-- @return TextureCache#TextureCache self (return value: cc.TextureCache)
|
2014-03-10 14:04:58 +08:00
|
|
|
|
|
|
|
return nil
|