Ejemplo n.º 1
0
  public void onPlay(Object sender) {
    if (G.sound) G.soundClick.start();

    CCScene s = CCScene.node();
    s.addChild(new SelectLayer(false));
    CCDirector.sharedDirector().replaceScene(CCFadeTransition.transition(0.7f, s));
  }
  public static CCScene scene() {
    CCScene scene = CCScene.node();
    CCLayer layer = new EnumerateScene();

    scene.addChild(layer);
    return scene;
  }
Ejemplo n.º 3
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
            WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    mGLSurfaceView = new CCGLSurfaceView(this);
    CCDirector director = CCDirector.sharedDirector();
    director.attachInView(mGLSurfaceView);
    director.setDeviceOrientation(CCDirector.kCCDeviceOrientationLandscapeLeft);
    setContentView(mGLSurfaceView);

    // show FPS
    CCDirector.sharedDirector().setDisplayFPS(true);

    // frames per second
    CCDirector.sharedDirector().setAnimationInterval(1.0f / 60.0f);

    CCScene scene = CCScene.node();
    scene.addChild(new Box2DTestLayer());

    // Make the Scene active
    CCDirector.sharedDirector().runWithScene(scene);
  }
Ejemplo n.º 4
0
  public static CCScene scene() {
    CCScene scene = CCScene.node();
    CCLayer layer = new MainLayer();

    scene.addChild(layer);

    return scene;
  }
  public static CCScene scene() {
    prev = 0;
    ActivityAccesser ac = ActivityAccesser.getInstance();
    rlActivity = ac.getLa();
    CCScene scene = CCScene.node();
    CCColorLayer layer = new RGLightLayer(ccColor4B.ccc4(255, 255, 255, 255));

    scene.addChild(layer);

    return scene;
  }
Ejemplo n.º 6
0
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    app = this;
    myHelper = new MySQLiteHelper(this, "my.db", null, 1);
    // 将文件中的内容保存到数据库中
    insertAndUpdateData(myHelper);
    int testnum = GetNum();
    testnum--;
    String s = MainActivity.queryData(myHelper, testnum * 20 + 1, testnum * 20 + 20);
    int cnt = 0, num = 0;
    String temp = "";
    for (int i = 0; i < s.length(); i++) {
      if (s.charAt(i) == '\n') {
        num++;
        temp += s.charAt(i);
        if (num % 2 == 0) {
          strArray[cnt++] = temp;
          temp = "";
          num = 0;
        }
      } else {
        temp += s.charAt(i);
      }
    }
    requestWindowFeature(Window.FEATURE_NO_TITLE);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_FULLSCREEN, WindowManager.LayoutParams.FLAG_FULLSCREEN);
    getWindow()
        .setFlags(
            WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON,
            WindowManager.LayoutParams.FLAG_KEEP_SCREEN_ON);

    mGLSurfaceView = new CCGLSurfaceView(this);
    setContentView(mGLSurfaceView);

    CCDirector my_director = CCDirector.sharedDirector();
    my_director.attachInView(mGLSurfaceView);

    CCDirector.sharedDirector().setDisplayFPS(true);
    CCDirector.sharedDirector().setAnimationInterval(1.0f / 30);

    CCScene scene = CCScene.node();

    MenuLayer menuLayer = new MenuLayer();
    scene.addChild(menuLayer);

    CCDirector.sharedDirector().runWithScene(scene);
  }
  @Override
  protected void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    CCGLSurfaceView surfaceView = new CCGLSurfaceView(this);
    setContentView(surfaceView);

    director = CCDirector.sharedDirector();
    director.attachInView(surfaceView); // ¿ªÆôÏß³Ì

    director.setDeviceOrientation(CCDirector.kCCDeviceOrientationLandscapeLeft);
    director.setDisplayFPS(true);
    director.setScreenSize(480, 320);

    CCScene ccScene = CCScene.node();
    ccScene.addChild(new WelcomLayer());
    director.runWithScene(ccScene);
  }
Ejemplo n.º 8
0
 @Override
 protected void onCreate(Bundle savedInstanceState) {
   super.onCreate(savedInstanceState);
   ccglSurfaceView = new CCGLSurfaceView(this);
   setContentView(ccglSurfaceView);
   // 导演(单列模式)
   ccDirector = CCDirector.sharedDirector();
   // 开启线程
   ccDirector.attachInView(ccglSurfaceView);
   // 设置方向
   ccDirector.setDeviceOrientation(CCDirector.kCCDeviceOrientationLandscapeLeft);
   // 设置屏幕分辨率(自动适配)
   ccDirector.setScreenSize(480, 320);
   // 显示当前游戏的帧率 30
   ccDirector.setDisplayFPS(true);
   // 创建场景
   ccScene = CCScene.node();
   // 添加图层
   ccScene.addChild(new MapLayer());
   // 导演运行场景
   ccDirector.runWithScene(ccScene);
 }
Ejemplo n.º 9
0
 public static CCScene makeScene() {
   CCScene scene = CCScene.node();
   CCLayer layer = new EpisodeLayer();
   scene.addChild(layer);
   return scene;
 }