Ejemplo n.º 1
0
    public Atlas3() {
      Log.i(LOG_TAG, "Atlas3 starts");

      // TODO: This needs to be done when binding
      // Create an aliased Atlas
      Texture2D.saveTexParameters();
      Texture2D.setAliasTexParameters();

      TileMapAtlas tilemap = TileMapAtlas.tilemap("tiles.png", "small.tga", 16, 16);

      Texture2D.restoreTexParameters();

      addChild(tilemap, 0, kTagTileMap);

      tilemap.setAnchorPoint(0, 0);

      IntervalAction s = ScaleBy.action(4, 0.8f);
      IntervalAction scaleBack = s.reverse();
      IntervalAction go = MoveBy.action(8, -1650, 0);
      IntervalAction goBack = go.reverse();

      IntervalAction seq = Sequence.actions(s, go, goBack, scaleBack);

      tilemap.runAction(seq);
      Log.i(LOG_TAG, "Atlas3 ends");
    }
Ejemplo n.º 2
0
    public Atlas4() {
      Log.i(LOG_TAG, "Atlas4 starts");

      // Create an Aliased Atlas
      Texture2D.saveTexParameters();
      Texture2D.setAliasTexParameters();

      TileMapAtlas tilemap = TileMapAtlas.tilemap("tiles.png", "levelmap.tga", 16, 16);

      Texture2D.restoreTexParameters();

      // If you are not going to use the Map, you can free it now
      // tilemap.releaseMap();
      // And if you are going to use, it you can access the data with:
      schedule("updateMap", 0.2f);

      addChild(tilemap, 0, kTagTileMap);

      tilemap.setAnchorPoint(0, 0);
      tilemap.setPosition(-20, -200);

      Log.i(LOG_TAG, "Atlas4 starts");
    }