上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 54 下一页
摘要: 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 凌度 阅读(478) 评论(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 凌度 阅读(442) 评论(0) 推荐(0) 编辑
摘要: 在init()函数里面加上scheduleUpdate(),这样才会每一帧都调用update()。Schedule() 函数有两种方式,一种带时间参数,一种不带时间参数。带时间参数的,间隔指定时间,然后执行指定的函数,达到定时刷新的效果。不带时间参数的,每一帧刷新,执行指定的函数,作用效果就和scheduleUpdate() 函数差不多效果,不过函数可以自己指定。// 系统计划任务,即每帧调用update函数 this.scheduleUpdate(); // 自定义计划任务 this.schedule(this.scoreCo... 阅读全文
posted @ 2013-12-12 19:31 凌度 阅读(1170) 评论(0) 推荐(0) 编辑
摘要: "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 凌度 阅读(559) 评论(0) 推荐(0) 编辑
摘要: /** * 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 凌度 阅读(5777) 评论(0) 推荐(1) 编辑
摘要: 1,锚点锚点就是所有旋转,移动,缩放的参考点。cocos2-x中默认的锚点是中心点。锚点用比例来表示范围为0-1,(0,0)点代表左下点,(1,1)代表右上点。设置的函数为setAnchorPoint(ccp(0.5, 0.5));2,旋转setRotation(angle) 其中angle为角度不是弧度。正数为顺时针旋转,负数为逆时针旋转。3,位置setPosition(ccp(xPos, yPos)) xPos和yPos为相对于父节点锚点的位置。4,缩放setScale(s); // 整体缩放setScaleX(s); // 原图片坐标X轴缩放setScaleY(s); // 原图片坐.. 阅读全文
posted @ 2013-11-29 14:21 凌度 阅读(477) 评论(0) 推荐(0) 编辑
摘要: 正确 var tmpShip3 = cc.Sprite.createWithSpriteFrameName("w1_1.png"); tmpShip3.setPosition(250,180); this.addChild(tmpShip3); var animFrames3 = []; // 将所有帧存入一个数组 for (var i=1;i<=4;i++) { //采用循环添加动画的每一帧 var strPngN... 阅读全文
posted @ 2013-11-28 21:04 凌度 阅读(5623) 评论(1) 推荐(0) 编辑
摘要: cc.MoveTo是“移动到这里",而cc.MoveBy则是“相对于之前点再移动”,通俗一点就是说这里需要两个坐标pos1(x1,y1),pos2(x2,y2)。如果是cc.MoveTo的话,就是将对象由pos1移动到pos2,而cc.MoveBy则是说对象的终坐标是在pos1的基础上再加上(矢量相加)pos2,终坐标pos3=pos1+pos2。scaleEffect:function() { var start1_3 = cc.Sprite.createWithSpriteFrameName("transcription1.png"); start1_3.se 阅读全文
posted @ 2013-11-21 20:09 凌度 阅读(24210) 评论(2) 推荐(1) 编辑
摘要: //创建标签var helloLabel = cc.LabelTTF.create("Hello World", "Arial", 38);//设置位置 helloLabel.setPosition(cc.p(100,100));//添加到layer this.addChild(helloLabel, 5);//改变颜色,不可reverse var hurtColor = cc.TintTo.create(2.5,-255,0,0);//移动并同时改变颜色 helloLabel.runAction(cc.Spawn.... 阅读全文
posted @ 2013-11-21 19:28 凌度 阅读(5035) 评论(0) 推荐(0) 编辑
摘要: Classcc.SpriteDefined in:CCSprite.jsExtendscc.NodeRGBAClass SummaryConstructor AttributesConstructor Name and Descriptioncc.Sprite()cc.Sprite is a 2d image ( http://en.wikipedia.org/wiki/Sprite_(computer_graphics) )cc.Sprite can be created with an image, or with a sub-rectangle of an image.Field Sum 阅读全文
posted @ 2013-11-14 20:16 凌度 阅读(3673) 评论(0) 推荐(0) 编辑
上一页 1 ··· 32 33 34 35 36 37 38 39 40 ··· 54 下一页