Пример #1
0
        public void Resize(int tile_width, int tile_height)
        {
            int w = (TargetLayer.Width / _mul) + 1;
            int h = (TargetLayer.Height / _mul) + 1;

            Dispose();

            _cells = new LayerCell[w * h];
            _width = w;

            int   index  = 0;
            Point offset = new Point();

            for (int y = 0; y < h; y++)
            {
                offset.Y = y * _mul;
                for (int x = 0; x < w; x++)
                {
                    offset.X      = x * _mul;
                    _cells[index] = new LayerCell(offset, tile_width, tile_height);
                    index++;
                }
            }

            _tile_w = tile_width;
            _tile_h = tile_height;
        }
Пример #2
0
        public void Resize(int tile_width, int tile_height)
        {
            int w = (TargetLayer.Width / _mul) + 1;
            int h = (TargetLayer.Height / _mul) + 1;

            Dispose();

            _cells = new LayerCell[w * h];
            _width = w;

            int index = 0;
            Point offset = new Point();
            for (int y = 0; y < h; y++)
            {
                offset.Y = y * _mul;
                for (int x = 0; x < w; x++)
                {
                    offset.X = x * _mul;
                    _cells[index] = new LayerCell(offset, tile_width, tile_height);
                    index++;
                }
            }

            _tile_w = tile_width;
            _tile_h = tile_height;
        }