Coder Social home page Coder Social logo

ccc_libs's Introduction

[toc]

c3d_libs

基于CocosCreator的一套框架

适配版本: 3.0(2.x版本请切换分支2.x)

目前已实现

  1. 弹框管理

暂未实现

  1. 弹框的资源销毁

快速入门

弹框框架使用

  1. 进入游戏时,调用初始化

  2. 弹框的prefab挂载一个脚本,脚本继承PopupBase

  3. 可以根据逻辑调用了

API

弹框管理

初始化

在使用前,需要进行初始胡

PopupManager.instance.init():void;

预加载

对于动态加载的,可能直接使用会造成一定耗时,可以进行预加载

PopupManager.instance.preLoad(option: { name?: string, prefab?: Prefab, url?: string }):void;

显示

PopupManager.instance.show(option: { name?: string, prefab?: Prefab, path?: string, priority?: number, params?: any, keep?: boolean }):void;

隐藏

PopupManager.instance.hide(name:string):void;

隐藏所有

PopupManager.instance.hideAll():void;

移除

PopupManager.instance.remove(name:string):void;

移除所有

PopupManager.instance.removeAll(name:string):void;

获取当前弹框的名字

PopupManager.instance.getCurrentName(): string | null;

根据弹框名获取弹框

PopupManager.instance.getPopup(name: string): Node | null;

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.