Example #1
0
        public void DrawUpBlend(int index, Point point)
        {
            if (!CheckImage(index))
            {
                return;
            }

            MImage mi = _images[index];

            point.Y -= mi.Height;


            if (point.X >= Settings.ScreenWidth || point.Y >= Settings.ScreenHeight || point.X + mi.Width < 0 || point.Y + mi.Height < 0)
            {
                return;
            }

            bool oldBlend = DXManager.Blending;

            DXManager.SetBlend(true, 1);

            DXManager.Draw(mi.Image, new Rectangle(0, 0, mi.Width, mi.Height), new Vector3((float)point.X, (float)point.Y, 0.0F), Color.White);

            DXManager.SetBlend(oldBlend);
            mi.CleanTime = CMain.Time + Settings.CleanDelay;
        }
Example #2
0
        public void DrawUp(int index, int x, int y)
        {
            if (x >= Settings.ScreenWidth)
            {
                return;
            }

            if (!CheckImage(index))
            {
                return;
            }

            MImage mi = _images[index];

            y -= mi.Height;
            if (y >= Settings.ScreenHeight)
            {
                return;
            }
            if (x + mi.Width < 0 || y + mi.Height < 0)
            {
                return;
            }

            DXManager.Draw(mi.Image, new Rectangle(0, 0, mi.Width, mi.Height), new Vector3(x, y, 0.0F), Color.White);

            mi.CleanTime = CMain.Time + Settings.CleanDelay;
        }
Example #3
0
        public void DrawTinted(int index, Point point, Color colour, Color Tint, bool offSet = false)
        {
            if (!CheckImage(index))
            {
                return;
            }

            MImage mi = _images[index];

            if (offSet)
            {
                point.Offset(mi.X, mi.Y);
            }

            if (point.X >= Settings.ScreenWidth || point.Y >= Settings.ScreenHeight || point.X + mi.Width < 0 || point.Y + mi.Height < 0)
            {
                return;
            }

            DXManager.Draw(mi.Image, new Rectangle(0, 0, mi.Width, mi.Height), new Vector3((float)point.X, (float)point.Y, 0.0F), colour);

            if (mi.HasMask)
            {
                DXManager.Draw(mi.MaskImage, new Rectangle(0, 0, mi.Width, mi.Height), new Vector3((float)point.X, (float)point.Y, 0.0F), Tint);
            }

            mi.CleanTime = CMain.Time + Settings.CleanDelay;
        }
Example #4
0
        public void Draw(int index, Point point, Size size, Color colour)
        {
            if (!CheckImage(index))
            {
                return;
            }

            MImage mi = _images[index];

            if (point.X >= Settings.ScreenWidth || point.Y >= Settings.ScreenHeight || point.X + size.Width < 0 || point.Y + size.Height < 0)
            {
                return;
            }

            float scaleX = (float)size.Width / mi.Width;
            float scaleY = (float)size.Height / mi.Height;

            Matrix matrix = Matrix.Scaling(scaleX, scaleY, 0);

            DXManager.Sprite.Transform = matrix;
            DXManager.Draw(mi.Image, new Rectangle(0, 0, mi.Width, mi.Height), new Vector3((float)point.X / scaleX, (float)point.Y / scaleY, 0.0F), Color.White);

            DXManager.Sprite.Transform = Matrix.Identity;

            mi.CleanTime = CMain.Time + Settings.CleanDelay;
        }
Example #5
0
        public void Draw(int index, Rectangle section, Point point, Color colour, bool offSet)
        {
            if (!CheckImage(index))
            {
                return;
            }

            MImage mi = _images[index];

            if (offSet)
            {
                point.Offset(mi.X, mi.Y);
            }


            if (point.X >= Settings.ScreenWidth || point.Y >= Settings.ScreenHeight || point.X + mi.Width < 0 || point.Y + mi.Height < 0)
            {
                return;
            }

            if (section.Right > mi.Width)
            {
                section.Width -= section.Right - mi.Width;
            }

            if (section.Bottom > mi.Height)
            {
                section.Height -= section.Bottom - mi.Height;
            }

            DXManager.Draw(mi.Image, section, new Vector3((float)point.X, (float)point.Y, 0.0F), colour);

            mi.CleanTime = CMain.Time + Settings.CleanDelay;
        }
Example #6
0
        public void DrawBlend(int index, Point point, Color colour, bool offSet = false, float rate = 1)
        {
            if (!CheckImage(index))
            {
                return;
            }

            MImage mi = _images[index];

            if (offSet)
            {
                point.Offset(mi.X, mi.Y);
            }

            if (point.X >= Settings.ScreenWidth || point.Y >= Settings.ScreenHeight || point.X + mi.Width < 0 || point.Y + mi.Height < 0)
            {
                return;
            }

            bool oldBlend = DXManager.Blending;

            DXManager.SetBlend(true, rate);

            DXManager.Draw(mi.Image, new Rectangle(0, 0, mi.Width, mi.Height), new Vector3((float)point.X, (float)point.Y, 0.0F), colour);

            DXManager.SetBlend(oldBlend);
            mi.CleanTime = CMain.Time + Settings.CleanDelay;
        }