Example #1
0
        private void PaintTile( MapLayer layer, Vector2 position )
        {
            if( !_layerTileMap.ContainsKey( layer ) )
                _layerTileMap.Add( layer, 0 ); // the first tile is the default

            layer.SetTile( position, _layerTileMap[ layer ] );
        }
Example #2
0
 private void UnPaintTile( MapLayer layer, Vector2 position )
 {
     layer.SetTile( position, -1 );
 }
Example #3
0
        private void ux_AddLayer_Click( object sender, EventArgs e )
        {
            var dialog = new AddLayer( CurrentLevel.MapLayers );
            var result = dialog.ShowDialog();
            if( result == DialogResult.OK )
            {
                // create a layer object
                // TODO: make sure this is relative to one of the content directories...
                var layer = new MapLayer {
                    TileSetTexturePath = dialog.TileSet,
                    TileSize = dialog.TileSize,
                    Name = dialog.LayerName
                };

                CurrentLevel.MapLayers.Add( layer );

                RefreshLayerList();
            }
        }