Beispiel #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
            {
            }
        }
Beispiel #2
0
        public void DrawMiniText(string text, Vector2 point, Color color)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            int x = (int)point.X;
            int y = (int)point.Y;

            this.minifont.Font.DrawString(this.sprite, text, x, y, new Color4(color));
        }
Beispiel #3
0
        public void DrawMiniText(string text, Vector2 point, Color color, SaveData save)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            int x = (int)point.X;
            int y = (int)point.Y;

            text = this.ControlCharacterChange(text, save);
            this.minifont.Font.DrawString(this.sprite, text, x, y, new Color4(color));
        }
Beispiel #4
0
        public void DrawText(string text, Vector2 point)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            int   x     = (int)point.X;
            int   y     = (int)point.Y;
            Color color = Color.FromArgb(byte.MaxValue, 64, 56, 56);

            this.font.Font.DrawString(this.sprite, text, x, y, new Color4(color));
        }
Beispiel #5
0
        public void DrawText(string text, Vector2 point, SaveData save)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            int x = (int)point.X;
            int y = (int)point.Y;

            text = this.ControlCharacterChange(text, save);
            Color color = Color.FromArgb(byte.MaxValue, 64, 56, 56);

            this.font.Font.DrawString(this.sprite, text, x, y, new Color4(color));
        }
Beispiel #6
0
        public void DrawText(string text, Vector2 point, bool shadow)
        {
            if (!ShanghaiEXE.rend)
            {
                return;
            }
            int x = (int)point.X;
            int y = (int)point.Y;

            if (shadow)
            {
                Color color = Color.FromArgb(byte.MaxValue, 32, 32, 32);
                this.font.Font.DrawString(this.sprite, text, x + 1, y + 1, new Color4(color));
            }
            Color white = Color.White;

            this.font.Font.DrawString(this.sprite, text, x, y, new Color4(white));
        }
Beispiel #7
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
            {
            }
        }