Beispiel #1
0
        public void draw(int percent)
        {
            if ((DeathWalker.menu.Item("nobar").GetValue <bool>()))
            {
                return;
            }
            dxLine.Begin();
            var tPos     = sPos + new Vector2(((windowsW * percent) / (500)), 0);
            var tPosFull = sPos + new Vector2(windowsW / 5 - 5, 0);

            dxLine.Draw(new[]
            {
                new Vector2((int)sPos.X, (int)sPos.Y + 6f),
                new Vector2((int)tPosFull.X, (int)tPosFull.Y + 6f)
            }, new ColorBGRA(200, 0, 0, 220));
            dxLine.Draw(new[]
            {
                new Vector2((int)sPos.X, (int)sPos.Y + 6f),
                new Vector2((int)tPos.X, (int)tPos.Y + 6f)
            }, new ColorBGRA(0, 200, 0, 220));

            // Vector2 sPos = startPosition;
            //Drawing.DrawLine((int)from.X, (int)from.Y + 9f, (int)to.X, (int)to.Y + 9f, 9f, color);

            dxLine.End();
        }
Beispiel #2
0
 private void fillHPBar(Vector2 from, Vector2 to, System.Drawing.Color color)
 {
     dxLine.Begin();
     dxLine.Draw(new[]
     {
         new Vector2((int)from.X, (int)from.Y + 4f),
         new Vector2((int)to.X, (int)to.Y + 4f)
     },
                 new ColorBGRA(255, 255, 00, 90));
     dxLine.End();
 }
Beispiel #3
0
        private void fillHPBar(Vector2 from, Vector2 to, ColorBGRA color)
        {
            dxLine.Begin();

            dxLine.Draw(new[] {
                new Vector2((int)from.X, (int)from.Y + 4f),
                new Vector2((int)to.X, (int)to.Y + 4f)
            }, color);

            dxLine.End();
        }
Beispiel #4
0
        private void fillHPBar(Vector2 from, Vector2 to, System.Drawing.Color color)
        {
            dxLine.Begin();

            dxLine.Draw(new[]
            {
                new Vector2((int)from.X, (int)from.Y + 4f),
                new Vector2((int)to.X, (int)to.Y + 4f)
            }, new ColorBGRA(120, 224, 69, 90));
            // Vector2 sPos = startPosition;
            //Drawing.DrawLine((int)from.X, (int)from.Y + 9f, (int)to.X, (int)to.Y + 9f, 9f, color);

            dxLine.End();
        }
Beispiel #5
0
        public override void OnEndScene()
        {
            try
            {
                if (_line.IsDisposed)
                {
                    return;
                }

                _line.Begin();
                _line.Draw(new[] { new Vector2(X, Y), new Vector2(X + Width, Y) }, Color);
                _line.Draw(new[] { new Vector2(X, Y + Height / 2), new Vector2(X + Width, Y + Height / 2) }, Color);
                _line.Draw(new[] { new Vector2(X, Y), new Vector2(X, Y + Height / 2) }, Color);
                _line.Draw(new[] { new Vector2(X + Width, Y), new Vector2(X + Width, Y + Height / 2) }, Color);
                _line.End();
            }
            catch (Exception e)
            {
                Console.WriteLine(@"Common.Render.Rectangle.OnEndScene: " + e);
            }
        }
Beispiel #6
0
        public void draw(int percent)
        {
            dxLine.Begin();
            var tPos     = sPos + new Vector2(((windowsW * percent) / (500)), 0);
            var tPosFull = sPos + new Vector2(windowsW / 5 - 5, 0);

            dxLine.Draw(new[]
            {
                new Vector2((int)sPos.X, (int)sPos.Y + 6f),
                new Vector2((int)tPosFull.X, (int)tPosFull.Y + 6f)
            }, new ColorBGRA(200, 0, 0, 220));
            dxLine.Draw(new[]
            {
                new Vector2((int)sPos.X, (int)sPos.Y + 6f),
                new Vector2((int)tPos.X, (int)tPos.Y + 6f)
            }, new ColorBGRA(0, 200, 0, 220));

            // Vector2 sPos = startPosition;
            //Drawing.DrawLine((int)from.X, (int)from.Y + 9f, (int)to.X, (int)to.Y + 9f, 9f, color);

            dxLine.End();
        }
Beispiel #7
0
        /// <summary>
        ///     OnDraw event, specifies a drawing callback which is after IDirect3DDevice9::BeginScene and before
        ///     IDirect3DDevice9::EndScene.
        /// </summary>
        /// <param name="basePosition">
        ///     The base position
        /// </param>
        public override void OnDraw(Vector2 basePosition)
        {
            if (this.IsVisible)
            {
                basePosition.X += this.hideOffsetX;

                Sprite.Begin(SpriteFlags.AlphaBlend);

                Line.Begin();

                Line.Draw(
                    new[]
                {
                    new Vector2(basePosition.X - (this.Width / 2f), basePosition.Y),
                    new Vector2(basePosition.X - (this.Width / 2f), basePosition.Y + this.HeaderHeight)
                },
                    new ColorBGRA(0, 0, 0, 255 / 2));

                if (this.IsOpen || this.DrawBodyHeight > 0 || this.DrawFooterHeight > 0)
                {
                    Line.Draw(
                        new[]
                    {
                        new Vector2(basePosition.X - (this.Width / 2f), basePosition.Y + this.HeaderHeight),
                        new Vector2(
                            basePosition.X - (this.Width / 2f),
                            basePosition.Y + this.HeaderHeight + this.DrawBodyHeight)
                    },
                        new ColorBGRA(0, 0, 0, (byte)(255 / 1.5f)));
                    Line.Draw(
                        new[]
                    {
                        new Vector2(
                            basePosition.X - (this.Width / 2f),
                            basePosition.Y + this.HeaderHeight + this.DrawBodyHeight),
                        new Vector2(
                            basePosition.X - (this.Width / 2f),
                            basePosition.Y + this.HeaderHeight + this.DrawFooterHeight + this.DrawBodyHeight)
                    },
                        new ColorBGRA(0, 0, 0, (byte)(255 / 1.25f)));
                }

                Line.End();

                HeaderFont.DrawText(Sprite, this.Header, this.GetHeaderRectangle(basePosition), 0, this.HeaderTextColor);

                var rectangle = this.GetBodyRectangle(basePosition);
                if (this.IsOpen || rectangle.Height > 0)
                {
                    for (var i = 0; i < this.LinesList.Count; ++i)
                    {
                        var lineRectangle = rectangle;
                        lineRectangle.Y      += BodyFont.Description.Height * i;
                        lineRectangle.Height -= BodyFont.Description.Height * i;

                        BodyFont.DrawText(Sprite, this.LinesList[i], lineRectangle, 0, this.BodyTextColor);
                    }
                }

                var matrix = Sprite.Transform;

                if (this.Icon != NotificationIconType.None && this.IconTexture != null && !this.IconTexture.IsDisposed)
                {
                    Sprite.Transform = Matrix.Translation(basePosition.X - this.IconOffset, basePosition.Y + 0.5f, 0);
                    Sprite.Draw(this.IconTexture, this.IconColor);
                }

                if (HideTexture != null && !HideTexture.IsDisposed)
                {
                    Sprite.Transform = Matrix.Scaling(0.7f, 0.7f, 0f)
                                       * Matrix.Translation(
                        basePosition.X - this.Width + 5f,
                        basePosition.Y + this.HeaderHeight + this.BodyHeight + 1.5f,
                        0f);
                    Sprite.Draw(
                        HideTexture,
                        Color.White,
                        new SharpDX.Rectangle(0, 0, HideBitmap.Width, (int)this.DrawFooterHeight));
                }

                Sprite.Transform = matrix;

                Sprite.End();
            }
        }