Example #1
0
        public void SelectTile(Tile tile)
        {
            _selectedTile = tile;

            _annotations.Clear();

            if (_selectedTile != null)
            {
                TileCoord location = _tileLayer.TileToCoord(tile);
                int       x        = location.X * _tileSet.TileWidth;
                int       y        = location.Y * _tileSet.TileHeight;

                SelectionAnnot annot = new SelectionAnnot()
                {
                    Start = new Treefrog.Framework.Imaging.Point(x, y),
                    End   = new Treefrog.Framework.Imaging.Point(x + _tileSet.TileWidth, y + _tileSet.TileHeight),
                    Fill  = new SolidColorBrush(new Treefrog.Framework.Imaging.Color(192, 0, 0, 128)),
                };

                _annotations.Add(annot);
            }

            OnSelectedTileChanged(EventArgs.Empty);
        }