展会信息港展会大全

【cocos2d-js官方文档】十、log,cocos2d-js文档log
来源:互联网   发布日期:2015-09-28 15:35:08   浏览:2337次  

导读: 【cocos2d-js官方文档】十、log,cocos2d-js文档log api改动情况,左边为新增,右边为原来的。 cc.log 不变 cc.warn 新增 cc.error 新增...

【cocos2d-js官方文档】十、log,cocos2d-js文档log

api改动情况,左边为新增,右边为原来的。

cc.log不变

cc.warn 新增

cc.error 新增

cc.assert <-- cc.Assert

此次改造有以下几点原因:

添加原来没有的api:cc.warn、cc.error。

修改cc.Assert名称,使其符合开发规范。

新的api的使用范例:

cc.log("this is a log");

cc.log("this is a log for %s", "Cocos2d-html5");

cc.warn("this is a waring");

cc.warn("this is a waring for %s", "Cocos2d-html5");

cc.error("this is an error");

cc.error("this is an error for %s", "Cocos2d-html5");

cc.assert(false, "this is an assert");

cc.assert(false, "this is an assert for %s", "Cocos2d-html5");

然后今后会定义出msgCode.js

cc.msgCode = {

log1 : "this is a log",

log2 : "this is a log for %s",

warn1 : "this is a waring",

warn2 : "this is a waring for %s",

error1 : "this is an error",

error2 : "this is an error for %s",

assert1 : "this is an assert",

assert2 : "this is an assert for %s",

throw1 : "this is an throw",

throw2 : "this is an throw for %s", "Cocos2d-html5"

}

这样一来可以让消息字符串等到最大程度的复用并且利于管理。

转载:http://www.douapp.com/post/2454

高一数学必修一对数比较大小:1若1<x<10,那(log以十为底的x的对数)的平方; log以十为底x的平方; lg

晕··这表示方式真蛋疼,log以十为底不就是lg么,这三个你写成(lgx)

赞助本站

人工智能实验室

相关热词: android开发 应用开发

AiLab云推荐
推荐内容
展开

热门栏目HotCates

Copyright © 2010-2024 AiLab Team. 人工智能实验室 版权所有    关于我们 | 联系我们 | 广告服务 | 公司动态 | 免责声明 | 隐私条款 | 工作机会 | 展会港