Exemplo n.º 1
0
        public override void Draw(DevicePanel d)
        {
            if (!cached)
            {
                Cache();
            }

            int X = MapEditor.Instance.ShiftX - Map.Instance.CenterX + 400;
            int Y = MapEditor.Instance.ShiftY - Map.Instance.CenterY + 300;

            X += (int)(X * _rX) + _x;
            Y += (int)(Y * _rY) + _y;


            int xStart = 0, xEnd = 1, yStart = 0, yEnd = 1;

            if (_mX != 0)
            {
                xStart = (d.GetScreen().X - X) / _mX - 1;
                xEnd   = (d.GetScreen().Right - X) / _mX + 1;
            }
            if (_mY != 0)
            {
                yStart = (d.GetScreen().Y - Y) / _mY - 1;
                yEnd   = (d.GetScreen().Bottom - Y) / _mY + 1;
            }

            //if(_mX != 0 && _mY != 0 && Object.GetInt("cx") == 0 && Object.GetInt("cy") == 0)
            //    d.DrawBitmap((Object.GetBool("f")) ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), 0, 0, Map.Instance.Width, Map.Instance.Height, Selected, Transparency);
            //else
            for (int x = xStart; x < xEnd; x++)
            {
                for (int y = yStart; y < yEnd; y++)
                {
                    d.DrawBitmap(_f ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), X + _mX * x, Y + _mY * y, _size, Selected, Transparency);
                }
            }
        }
Exemplo n.º 2
0
        public override void Draw(DevicePanel d)
        {
            if (!cached) Cache();

            int X = MapEditor.Instance.ShiftX - Map.Instance.CenterX + 400;
            int Y = MapEditor.Instance.ShiftY - Map.Instance.CenterY + 300;

            X += (int)(X * _rX) + _x; 
            Y += (int)(Y * _rY) + _y;


            int xStart = 0, xEnd = 1, yStart = 0, yEnd = 1;
            if (_mX != 0)
            {
                xStart = (d.GetScreen().X - X) / _mX - 1;
                xEnd = (d.GetScreen().Right - X) / _mX + 1;
            }
            if (_mY != 0)
            {
                yStart = (d.GetScreen().Y - Y) / _mY - 1;
                yEnd = (d.GetScreen().Bottom - Y) / _mY + 1;
            }

            //if(_mX != 0 && _mY != 0 && Object.GetInt("cx") == 0 && Object.GetInt("cy") == 0)
            //    d.DrawBitmap((Object.GetBool("f")) ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), 0, 0, Map.Instance.Width, Map.Instance.Height, Selected, Transparency);
            //else
            for (int x = xStart; x < xEnd; x++)
            {
                for (int y = yStart; y < yEnd; y++)
                {
                    d.DrawBitmap(_f ? Image.GetCanvas().GetFlippedTexture(d._device) : Image.GetCanvas().GetTexture(d._device), X + _mX * x, Y + _mY * y, _size, Selected, Transparency); 
                }
            }
            
        }