摘要:
为屏幕添加触摸事件,将左上角坐标转换为左下角坐标 1 package com.arlen.cocos2d.touch01; 2 3 import org.cocos2d.layers.CCLayer; 4 import org.cocos2d.nodes.CCDirector; 5 import org.cocos2d.types.CGPoint; 6 7 import android.view.MotionEvent; 8 9 public class GameLayer extends CCLayer {10 11 // 接受用户的触摸事件,首先必须对当前图层进行设置12 1... 阅读全文
摘要:
淡入淡出、颜色渐变及动作重复执行import org.cocos2d.actions.base.CCRepeatForever;import org.cocos2d.actions.interval.CCFadeIn;import org.cocos2d.actions.interval.CCFadeOut;import org.cocos2d.actions.interval.CCMoveTo;import org.cocos2d.actions.interval.CCRepeat;import org.cocos2d.actions.interval.CCSequence;import o 阅读全文
摘要:
先后、同时执行多个动作及动作序列执行结束后的事件 1 import org.cocos2d.actions.instant.CCCallFunc; 2 import org.cocos2d.actions.interval.CCMoveTo; 3 import org.cocos2d.actions.interval.CCRotateTo; 4 import org.cocos2d.actions.interval.CCScaleTo; 5 import org.cocos2d.actions.interval.CCSequence; 6 import org.cocos2d.actions. 阅读全文
摘要:
向量的基本运算及动作 1 import org.cocos2d.actions.interval.CCJumpBy; 2 import org.cocos2d.actions.interval.CCMoveBy; 3 import org.cocos2d.layers.CCLayer; 4 import org.cocos2d.nodes.CCSprite; 5 import org.cocos2d.types.CGPoint; 6 7 public class GameLayer extends CCLayer { 8 9 private CCSprite spriteA... 阅读全文