posts - 535,comments - 60,views - 197万
12 2013 档案
三种被击效果
摘要:// 闪烁 this.runAction(cc.Blink.create(0.01,1)); // shake震动 var move = cc.MoveBy.create(0.05, cc._p(8, 8)); var move_back = move.reverse(); var move_seq = cc.Sequence.create(move, move_back); var move_rep = cc.RepeatForever.create(move_seq); this.runAct... 阅读全文
posted @ 2013-12-31 15:07 凌度 阅读(365) 评论(0) 推荐(0) 编辑
限制移动速度
摘要:processEvent:function (event) { if (this._bStop == true) return; if (this._state == STATE_PLAYING) { var delta = event.getDelta(); var curPos = this._ship.getPosition(); var pos = null; var limitSpeed = 15+MW.LEVEL; if (delta.x > l... 阅读全文
posted @ 2013-12-26 21:07 凌度 阅读(400) 评论(0) 推荐(0) 编辑
带冷却时间的按钮(二)
摘要:onSkillShade:function () { if (!this.lbSkillShade) { // 生成遮罩 var progress2 = cc.Sprite.createWithSpriteFrameName("ui_skill_shade.png"); this.lbSkillShade = cc.ProgressTimer.create(progress2); this.lbSkillShade.setType(cc.PROGRESS_TIMER_TYPE_RADIAL);... 阅读全文
posted @ 2013-12-24 15:22 凌度 阅读(485) 评论(0) 推荐(0) 编辑
带冷却时间的按钮(一)
摘要:// 技能CD var progressBox2 = cc.Sprite.createWithSpriteFrameName("ui_progress3.png"); progressBox2.setAnchorPoint(AnchorPointBottom); var progress2_xPos = winSize.width - 20; var progress2_yPos = winSize.height/2; progressBox2.setPosition(progress... 阅读全文
posted @ 2013-12-23 20:43 凌度 阅读(449) 评论(0) 推荐(0) 编辑
schedule和scheduleUpdate
摘要:在init()函数里面加上scheduleUpdate(),这样才会每一帧都调用update()。Schedule() 函数有两种方式,一种带时间参数,一种不带时间参数。带时间参数的,间隔指定时间,然后执行指定的函数,达到定时刷新的效果。不带时间参数的,每一帧刷新,执行指定的函数,作用效果就和scheduleUpdate() 函数差不多效果,不过函数可以自己指定。// 系统计划任务,即每帧调用update函数 this.scheduleUpdate(); // 自定义计划任务 this.schedule(this.scoreCo... 阅读全文
posted @ 2013-12-12 19:31 凌度 阅读(1177) 评论(0) 推荐(0) 编辑
cocos2d-html5对话界面设计
摘要:"use strict"var _dialogMsgBottom = null;var _dialogMsgTop = null;var _dialogMsgId = 0;var _dialogConfig = null;var _dialogId = 0;var DialogLayer = cc.Layer.extend({ init:function () { var bRet = false; if (this._super()) { // 底图 var sp = cc.Sprite.createWithSpr... 阅读全文
posted @ 2013-12-09 20:07 凌度 阅读(564) 评论(0) 推荐(0) 编辑
initWithSpriteFrameName和createWithSpriteFrameName
摘要:/** * Initializes a sprite with a sprite frame name. * A cc.SpriteFrame will be fetched from the cc.SpriteFrameCache by name. * If the cc.SpriteFrame doesn't exist it will raise an exception. * @param {String} spriteFrameName A key string that can fected a volid cc.SpriteFrame fr... 阅读全文
posted @ 2013-12-06 17:32 凌度 阅读(5783) 评论(0) 推荐(1) 编辑

< 2025年3月 >
23 24 25 26 27 28 1
2 3 4 5 6 7 8
9 10 11 12 13 14 15
16 17 18 19 20 21 22
23 24 25 26 27 28 29
30 31 1 2 3 4 5

点击右上角即可分享
微信分享提示