Giter Club home page Giter Club logo

ccalert's Introduction

CCAlert

CocosCreator 一个弹窗插件。

前言

刚接触 CocosCreator、JavaScript,写了一个游戏的弹窗插件,记录笔记的同时也分享给和我一样在学习道路上的小伙伴。代码规范包括逻辑等都欢迎新老客户提出宝贵意见。

效果图

效果图.gif

使用方法

这里注意: 1. Alertprefab 文件一定要放到 assets/resources 目录下,因为 cc.loader.loadRes 方法加载的需放在 resources2. Alertjs 文件勾选 `导入为插件的复选框,这样才能全局访问。不勾选的话可以在想使用的地方引用也可。

代码使用:Alert.show("文字内容", 确定按钮点击回调函数, true/false(是否显示取消按钮), 动画速度)

QQ20170804-154530.png

简书文章地址

总结

欢迎评论吐槽!

ccalert's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ccalert's Issues

重复弹框,前一个失效

如果同时弹出两个弹窗来,那么前一个就失效了,对于JS的变量生命周期实在是控制不来,改不了你的代码。你看看能不能修复一下

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.