Coder Social home page Coder Social logo

uiloader's Introduction

UILoader(资源加载和资源释放) TS库 2.x 版本(2.0.6 版本)

加载资源

void loadRes(url: string, type: typeof cc.Asset, callback: Function): void

void loadResArr(paths: Array<string>, callfun: Function): void;

void loadAudioClip(path: string, callfun: Function): void;

加载静态资源

void loadStaticRes(url: string, type: typeof cc.Asset, tag: string, callback: Function): void;

void loadStaticResArr(paths: Array<string>, tag: string, callfun: Function): void

加载静态资源,可对其进行引用计数

void loadSpriteFrame(path: string, callfun: Function, retainRes: boolean = false)

void loadSpriteFrames(paths: Array<string>, callfun: Function, retainRes: boolean = false);

对节点进行引用计数加一

 void retainNodeRes(node: cc.Node): void;

 void releaseNodeRes(node: cc.Node): void;

对节点进行引用计数减一

 void releaseNodeRes(node: cc.Node): void;

释放静态资源

void releaseStaticRes(tag: string): void;

引用计数加一

 void retatinRes(res: string): void;

 void releaseMusicRes(res: string): void;

 void retainArrayRes(res: string[]): void;

引用计数减一

void releaseRes(res: string): void;

void releaseArrayRes(res: string[]): void;

更新Sprite 组件 和 Button 组件纹理

void updateSpriteTexture(target: cc.Node, spriteFrame: cc.SpriteFrame): void;

void updateButtonTexture(target: cc.Node, normalSprite?: cc.SpriteFrame, pressedSprite?: cc.SpriteFrame, hoverSprite?: cc.SpriteFrame, disabledSprite?: cc.SpriteFrame): void;

获取缓存资源的数量

void getCacheCount(): number;

回收资源

void gc(): void;

uiloader's People

Contributors

luo976370248 avatar 1083921307 avatar

Watchers

James Cloos avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.