From 8fefb8f3e100976235dc83d6ae3785952d11c710 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9C=80=E8=90=8C=E5=B0=8F=E6=B1=90?= Date: Mon, 5 Jul 2021 20:51:43 +0800 Subject: cleanup --- meta/3rd/Cocos4.0/library/cc.TextureCache.lua | 101 ++++++++++++++++++++++++++ 1 file changed, 101 insertions(+) create mode 100644 meta/3rd/Cocos4.0/library/cc.TextureCache.lua (limited to 'meta/3rd/Cocos4.0/library/cc.TextureCache.lua') diff --git a/meta/3rd/Cocos4.0/library/cc.TextureCache.lua b/meta/3rd/Cocos4.0/library/cc.TextureCache.lua new file mode 100644 index 00000000..55753f10 --- /dev/null +++ b/meta/3rd/Cocos4.0/library/cc.TextureCache.lua @@ -0,0 +1,101 @@ +---@meta + +---@class cc.TextureCache :cc.Ref +local TextureCache={ } +cc.TextureCache=TextureCache + + + + +---* Reload texture from the image file.
+---* If the file image hasn't loaded before, load it.
+---* Otherwise the texture will be reloaded from the file image.
+---* param fileName It's the related/absolute path of the file image.
+---* return True if the reloading is succeed, otherwise return false. +---@param fileName string +---@return boolean +function TextureCache:reloadTexture (fileName) end +---* Unbind all bound image asynchronous load callbacks.
+---* since v3.1 +---@return self +function TextureCache:unbindAllImageAsync () end +---* Deletes a texture from the cache given a its key name.
+---* param key It's the related/absolute path of the file image.
+---* since v0.99.4 +---@param key string +---@return self +function TextureCache:removeTextureForKey (key) end +---* Purges the dictionary of loaded textures.
+---* Call this method if you receive the "Memory Warning".
+---* In the short term: it will free some resources preventing your app from being killed.
+---* In the medium term: it will allocate more resources.
+---* In the long term: it will be the same. +---@return self +function TextureCache:removeAllTextures () end +---* js NA
+---* lua NA +---@return string +function TextureCache:getDescription () end +---* Output to CCLOG the current contents of this TextureCache.
+---* This will attempt to calculate the size of each texture, and the total texture memory in use.
+---* since v1.0 +---@return string +function TextureCache:getCachedTextureInfo () end +---@overload fun(cc.Image:cc.Image,string:string):cc.Texture2D +---@overload fun(cc.Image0:string):cc.Texture2D +---@param image cc.Image +---@param key string +---@return cc.Texture2D +function TextureCache:addImage (image,key) end +---* Unbind a specified bound image asynchronous callback.
+---* In the case an object who was bound to an image asynchronous callback was destroyed before the callback is invoked,
+---* the object always need to unbind this callback manually.
+---* param filename It's the related/absolute path of the file image.
+---* since v3.1 +---@param filename string +---@return self +function TextureCache:unbindImageAsync (filename) end +---* Returns an already created texture. Returns nil if the texture doesn't exist.
+---* param key It's the related/absolute path of the file image.
+---* since v0.99.5 +---@param key string +---@return cc.Texture2D +function TextureCache:getTextureForKey (key) end +---* Get the file path of the texture
+---* param texture A Texture2D object pointer.
+---* return The full path of the file. +---@param texture cc.Texture2D +---@return string +function TextureCache:getTextureFilePath (texture) end +---* Reload texture from a new file.
+---* This function is mainly for editor, won't suggest use it in game for performance reason.
+---* param srcName Original texture file name.
+---* param dstName New texture file name.
+---* since v3.10 +---@param srcName string +---@param dstName string +---@return self +function TextureCache:renameTextureWithKey (srcName,dstName) end +---* Removes unused textures.
+---* Textures that have a retain count of 1 will be deleted.
+---* It is convenient to call this method after when starting a new Scene.
+---* since v0.8 +---@return self +function TextureCache:removeUnusedTextures () end +---* Deletes a texture from the cache given a texture. +---@param texture cc.Texture2D +---@return self +function TextureCache:removeTexture (texture) end +---* Called by director, please do not called outside. +---@return self +function TextureCache:waitForQuit () end +---* +---@param suffix string +---@return self +function TextureCache:setETC1AlphaFileSuffix (suffix) end +---* +---@return string +function TextureCache:getETC1AlphaFileSuffix () end +---* js ctor +---@return self +function TextureCache:TextureCache () end \ No newline at end of file -- cgit v1.2.3