Пример #1
0
 private void Inflate(ref GameOverlay.Drawing.Rectangle rect, int inflateX, int inflateY)
 {
     rect.Left   -= inflateX;
     rect.Top    -= inflateY;
     rect.Right  += inflateX;
     rect.Bottom += inflateY;
 }
Пример #2
0
 private void DontMoveInZone(Rectangle zone, ref float curDx, ref float curDy)
 {
     if (zone.Left <= s.SizeX / 2f && s.SizeX / 2f <= zone.Right &&
         zone.Top <= s.SizeY / 2f && s.SizeY / 2f <= zone.Bottom)
     {
         curDx = 0;
         curDy = 0;
     }
 }
Пример #3
0
        public static Rectangle GetEnemyHead(YoloItem nearestEnemy)
        {
            var nearestEnemyHead = Rectangle.Create(
                (float)nearestEnemy.X + Convert.ToInt32(nearestEnemy.Width * (1f - Settings.HeadWidth) / 2f),
                y: Convert.ToInt32(nearestEnemy.Y),
                Convert.ToInt32(Settings.HeadWidth * nearestEnemy.Width),
                Convert.ToInt32(Settings.HeadHeight * nearestEnemy.Height));

            return(nearestEnemyHead);
        }
Пример #4
0
        public static Rectangle GetEnemyBody(YoloItem nearestEnemy)
        {
            var nearestEnemyBody = Rectangle.Create(
                (float)nearestEnemy.X + Convert.ToInt32(nearestEnemy.Width * (1f - Settings.BodyWidth) / 2f),
                (float)nearestEnemy.Y + Convert.ToInt32(nearestEnemy.Height * (1f - Settings.BodyHeight) / 2f),
                Convert.ToInt32(Settings.BodyWidth * nearestEnemy.Width),
                Convert.ToInt32(Settings.BodyHeight * nearestEnemy.Height));

            return(nearestEnemyBody);
        }
Пример #5
0
        private void DrawProgressBarDirectX(GameOverlay.Drawing.Graphics g, GameOverlay.Drawing.SolidBrush bgBrush, GameOverlay.Drawing.SolidBrush foreBrush, float x, float y, float width, float height, float value, float maximum = 100)
        {
            // Draw BG.
            g.DrawRectangle(bgBrush, x, y, x + width, y + height, 3f);

            // Draw FG.
            GameOverlay.Drawing.Rectangle foreRect = new GameOverlay.Drawing.Rectangle(
                x,
                y,
                x + ((width * value / maximum)),
                y + (height)
                );
            g.FillRectangle(foreBrush, foreRect);
        }
Пример #6
0
        public KeyboardOverlay()
        {
            GameOverlay.Drawing.Rectangle rect = GetDesktopRect();
            m_overlay = new GameOverlay.Windows.GraphicsWindow((int)rect.Left, (int)rect.Top, (int)(rect.Right - rect.Left), (int)(rect.Bottom - rect.Top),
                                                               new GameOverlay.Drawing.Graphics()
            {
                PerPrimitiveAntiAliasing = true, TextAntiAliasing = true
            });

            m_overlay.DrawGraphics += DrawGraphics;
            m_overlay.Create();

            m_overlay.IsTopmost = true;
            m_overlay.Show();
        }
Пример #7
0
 public void DrawPlaying(YoloItem enemy, bool isAiming)
 {
     mainWnd.window.X = 1920 / 2 - s.SizeX / 2;
     mainWnd.window.Y = 1080 / 2 - s.SizeY / 2;
     mainWnd.graphics.BeginScene();
     mainWnd.graphics.ClearScene();
     // draw area
     //mainWnd.graphics.DrawRectangle(mainWnd.graphics.blueBrush, 0, 0, s.SizeX, s.SizeY, 2);
     // draw crossfire
     mainWnd.graphics.FillRectangle(isAiming ? mainWnd.graphics.redBrush : mainWnd.graphics.blueBrush,
                                    Rectangle.Create(s.SizeX / 2 - 2, s.SizeY / 2 - 2, 4, 4));
     //mainWnd.graphics.WriteText(
     //    $"FPS {mainWnd.graphics.FPS}");
     // draw targets
     DrawItem(enemy);
     mainWnd.graphics.EndScene();
 }
Пример #8
0
        private void IfInsideZone1SlowlyMoveToZone2(ref float curDx, ref float curDy, Rectangle zone1, Rectangle zone2)
        {
            if (zone1.Left <= s.SizeX / 2f && s.SizeX / 2f <= zone1.Right &&
                zone1.Top <= s.SizeY / 2f && s.SizeY / 2f <= zone1.Bottom)
            {
                var destX = zone2.Left + zone2.Width / 2f;
                curDx = destX - s.SizeX / 2f;
                var minWidth = Math.Max(1f, zone2.Width / 10f);
                curDx = Math.Sign(curDx) * Math.Min(Math.Abs(curDx), minWidth);

                var destY = zone2.Top + zone2.Height / 2f;
                curDy = destY - s.SizeY / 2f;
                var minHeight = Math.Max(1f, zone2.Height / 10f);
                curDy = Math.Sign(curDy) * Math.Min(Math.Abs(curDy), minHeight);
            }
        }