Example #1
0
        private void flipIt(float dt)
        {
            var        map   = (CCTMXTiledMap)this[kTagTileMap];
            CCTMXLayer layer = map.LayerNamed("Layer 0");

            //blue diamond
            var  tileCoord = new CCPoint(1, 10);
            uint flags;
            uint GID = layer.TileGIDAt(tileCoord, out flags);

            // Vertical
            if ((flags & CCTMXTileFlags.Vertical) != 0)
            {
                flags &= ~CCTMXTileFlags.Vertical;
            }
            else
            {
                flags |= CCTMXTileFlags.Vertical;
            }
            layer.SetTileGID(GID, tileCoord, flags);


            tileCoord = new CCPoint(1, 8);
            GID       = layer.TileGIDAt(tileCoord, out flags);
            // Vertical
            if ((flags & CCTMXTileFlags.Vertical) != 0)
            {
                flags &= ~CCTMXTileFlags.Vertical;
            }
            else
            {
                flags |= CCTMXTileFlags.Vertical;
            }
            layer.SetTileGID(GID, tileCoord, flags);


            tileCoord = new CCPoint(2, 8);
            GID       = layer.TileGIDAt(tileCoord, out flags);
            // Horizontal
            if ((flags & CCTMXTileFlags.Horizontal) != 0)
            {
                flags &= ~CCTMXTileFlags.Horizontal;
            }
            else
            {
                flags |= CCTMXTileFlags.Horizontal;
            }
            layer.SetTileGID(GID, tileCoord, flags);
        }
Example #2
0
        public TMXBug987()
        {
            CCTMXTiledMap map = new CCTMXTiledMap("TileMaps/orthogonal-test6");

            AddChild(map, 0, kTagTileMap);

            /*
             * CCArray* childs = map.getChildren();
             * CCTMXLayer* node;
             * object* pObject = NULL;
             * CCARRAY_FOREACH(childs, pObject)
             * {
             *  node = (CCTMXLayer*) pObject;
             *  CC_BREAK_IF(!node);
             *  node.Texture.setAntiAliasTexParameters();
             * }
             */

            map.AnchorPoint = CCPoint.AnchorLowerLeft;
            CCTMXLayer layer = map.LayerNamed("Tile Layer 1");

            layer.SetTileGID(3, new CCPoint(2, 2));
        }