Ejemplo n.º 1
0
        public virtual void DrawImage(
            IRenderer device,
            string te,
            Rectangle _rect,
            bool leftpoint,
            Vector2 _point,
            Color color)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            string _texture = te + ".png";

            try
            {
                var    dgDevice = (MySlimDG)device;
                Point  point    = new Point((int)_point.X, (int)_point.Y);
                var    dx_point = new SlimDX.Vector2(point.X, point.Y);
                Matrix matrix   = Matrix.AffineTransformation2D(1f, SlimDX.Vector2.Zero, MyMath.Rad(0.0f), dx_point);
                dgDevice.sprite.Transform = matrix;
                SlimDX.Vector3 vector3 = !leftpoint ? new SlimDX.Vector3(_rect.Width / 2, _rect.Height / 2, 0.0f) : new SlimDX.Vector3(0.0f, 0.0f, 0.0f);
                this.LoadTexture(_texture);
                dgDevice.sprite.Draw(this.form.Tex[_texture].Texture, new Rectangle?(_rect), new SlimDX.Vector3?(vector3), new SlimDX.Vector3?(new SlimDX.Vector3(0.0f, 0.0f, 0.0f)), new Color4(color));
                dgDevice.sprite.Transform = Matrix.Identity;
            }
            catch
            {
            }
        }
Ejemplo n.º 2
0
        public virtual void DrawImage(
            IRenderer device,
            string te,
            Rectangle _rect,
            bool leftpoint,
            Vector2 _point,
            float scall,
            float rotation,
            bool rebirth,
            Color color)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            string _texture = te + ".png";

            try
            {
                var    dgDevice = (MySlimDG)device;
                Point  point    = new Point((int)_point.X, (int)_point.Y);
                var    dx_point = new SlimDX.Vector2(point.X, point.Y);
                Matrix matrix;
                if (!rebirth)
                {
                    matrix = Matrix.AffineTransformation2D(scall, SlimDX.Vector2.Zero, MyMath.Rad(rotation), dx_point);
                }
                else
                {
                    Quaternion     rotation1      = new Quaternion(0.0f, -1f, 0.0f, 0.0f);
                    SlimDX.Vector3 rotationCenter = new SlimDX.Vector3(0.0f, 0.0f, 0.0f);
                    SlimDX.Vector3 translation    = new SlimDX.Vector3(_point.X, _point.Y, 0.0f);
                    matrix = Matrix.AffineTransformation(scall, rotationCenter, rotation1, translation);
                }
                dgDevice.sprite.Transform = matrix;
                SlimDX.Vector3 vector3 = !leftpoint ? new SlimDX.Vector3(_rect.Width / 2, _rect.Height / 2, 0.0f) : new SlimDX.Vector3(0.0f, 0.0f, 0.0f);
                this.LoadTexture(_texture);
                dgDevice.sprite.Draw(this.form.Tex[_texture].Texture, new Rectangle?(_rect), new SlimDX.Vector3?(vector3), new SlimDX.Vector3?(new SlimDX.Vector3(0.0f, 0.0f, 0.0f)), new Color4(color));
                dgDevice.sprite.Transform = Matrix.Identity;
            }
            catch
            {
            }
        }