public static void Main(string[] args) { OverlayWindow window = new OverlayWindow(new OverlayCreationOptions() { BypassTopmost = false, Height = 1080, Width = 1920, WindowTitle = "test", X = 0, Y = 0 }); while (!window.IsInitialized) { } D2DDevice device = new D2DDevice(new DeviceOptions() { AntiAliasing = true, Hwnd = window.WindowHandle, MeasureFps = false, VSync = false }); var red = device.CreateSolidColorBrush(1.0f, 0.0f, 0.0f); device.BeginScene(); device.ClearScene(); device.DrawLine(100, 100, 800, 800, 1.0f, red); device.EndScene(); Console.ReadLine(); }
private static void _frameTimer_OnFrame(FrameTimer timer, D2DDevice device) { _notification.Setup(100, 100, 310, 94); device.ClearScene(); device.DrawShape(_notification); }
// public Vector2[] points = new Vector2[Constants.Llegbones.Length + Constants.Rlegbones.Length + Constants.Spinebones.Length + Constants.Larmbones.Length + Constants.Rarmbones.Length]; private void _frameTimer_OnFrame(FrameTimer timer, D2DDevice device) { if (!device.IsDrawing) { _initializeGraphicObjects = true; return; } device.ClearScene(_backgroundColor); //device.DrawTextWithBackground("FPS: " + device.FramesPerSecond, 0, 0, _font, _redBrush, _blackBrush); //device.DrawTextWithBackground(text, 0, 20, _font, _redBrush, _blackBrush); if (OtherCheatsRealisation.IsWallHackEspEnabled()) { ESPRectangle[] Rects = OtherCheatsRealisation.Rects; Vector3 tempVector3 = new Vector3(), tempVector3_2 = new Vector3(); for (int i = 0; i < Rects.Length; i++) { if (Rects[i].topPosX != 0 && Rects[i].topPosY != 0) { device.DrawCircle(Rects[i].topPosX, Rects[i].topPosY, 5 * (1000 / Rects[i].lenToPlayer), 3, Rects[i].IsEnemy ? _redBrush : _greenBrush); } if (Rects[i].downPosX != 0 && Rects[i].downPosY != 0) { float cof = (200 / Rects[i].lenToPlayer); float[] newPos; newPos = Сentering(Rects[i].downPosX, Rects[i].downPosY, 100 * cof, 20 * cof, device, _blackBrush); device.FillRectangle(newPos[0] + 1, newPos[1] + 1, newPos[0] + (Rects[i].hp * 100 - 1) * cof, newPos[1] + (20 - 1) * cof, device.CreateSolidColorBrush(1 - Rects[i].hp, Rects[i].hp, 0)); } //device.DrawTextWithBackground(q, Rects[i].downPosX, Rects[i].downPosY, _font, 14, _blueBrush, _greenBrush); } } if (aimCheats.IsNoRecoilSaveEnabled()) { device.FillCircle(aimCheats.RecoilCrossX, aimCheats.RecoilCrossY, 4, _redBrush); } if (aimCheats.IsAimEnabled()) { device.DrawCircle(Constants.screenWidth / 2, Constants.screenHeight / 2, aimCheats.AIM_RADIUS, 2, _blueBrush); } //DrawTSkeleton(device); //DrawSkeletonT(device); //DrawCTSkeleton(device); // DrawTSkeleton(device); //DrawSkeletonT(device); // DrawSkeletonCT(device); /*for (int i = 0; i < points.Length; i++) * device.DrawTextWithBackground(i.ToString(), points[i].X, points[i].Y, _font, _redBrush, _blackBrush);*/ /*for (int i = 0; i+1 < bones_points.Length; i += 2) * { * device.DrawLine(bones_points[i].X, bones_points[i].Y, bones_points[i+1].X, bones_points[i+1].Y, 1, _redBrush); * }*/ //DrawText(device); }
private void _frameTimer_OnFrame(FrameTimer timer, D2DDevice device) { // the render loop will call device.BeginScene() and device.EndScene() for us if (!device.IsDrawing) { _initializeGraphicObjects = true; return; } // clear the scene / fill it with our background device.ClearScene(_backgroundColor); // text // the background is dynamically adjusted to the text's size device.DrawTextWithBackground("FPS: " + device.FramesPerSecond, 10, 10, _font, _redBrush, _blackBrush); // primitives device.DrawCircle(100, 100, 50, 2.0f, _redBrush); device.DrawDashedCircle(250, 100, 50, 2.0f, _greenBrush); // Rectangle.Create offers a method to create rectangles with x, y, width, heigth device.DrawRectangle(Rectangle.Create(350, 50, 100, 100), 2.0f, _blueBrush); device.DrawRoundedRectangle(RoundedRectangle.Create(500, 50, 100, 100, 6.0f), 2.0f, _redBrush); device.DrawTriangle(650, 150, 750, 150, 700, 50, _greenBrush, 2.0f); // lines device.DrawLine(50, 175, 750, 175, 2.0f, _blueBrush); device.DrawDashedLine(50, 200, 750, 200, 2.0f, _redBrush); // outlines & filled device.OutlineCircle(100, 275, 50, 4.0f, _redBrush, _blackBrush); device.FillCircle(250, 275, 50, _greenBrush); device.OutlineRectangle(Rectangle.Create(350, 225, 100, 100), 4.0f, _blueBrush, _blackBrush); _gradient.SetRange(500, 225, 600, 325); device.FillRoundedRectangle(RoundedRectangle.Create(500, 225, 100, 100, 6.0f), _gradient); device.FillTriangle(650, 325, 750, 325, 700, 225, _greenBrush); // images device.DrawImage(_image, 310, 375); }
public void DestroyInstance() { _frameTimer.Stop(); //Begin and clear scene to stop last draw sticking on screen _device.BeginScene(); _device.ClearScene(); _frameTimer.Dispose(); _device.Dispose(); _window.Dispose(); _window = null; _device = null; _frameTimer = null; }
private static void Timer_OnFrameStart(FrameTimer timer, D2DDevice device) { device.BeginScene(); device.ClearScene(); device.DrawTextWithBackground(device.FPS.ToString(), new Point(10, 20), font, red, backgroundBrush); DrawRadarBackground(device, new Rectangle(100, 100, 400, 400), 10.0f); //for (int i = 0; i < 100; i++) //{ // DrawRadarBackground(device, new Rectangle(100, 100, 400, 400), 10.0f); //} device.EndScene(); }
private void _frameTimer_OnFrame(FrameTimer timer, D2DDevice device) { // the render loop will call device.BeginScene() and device.EndScene() for us if (!device.IsDrawing) { _initializeGraphicObjects = true; return; } device.ClearScene(); if (Config.focused) { if (vars.drawFOV == 1) { device.DrawCircle(vars.ScreenWidth / 2 + 1, vars.ScreenHeight / 2 + 1, Config.FOV, 1, _blueBrush); //Draw FOV circle } //Crosshair aimPunch Point centralPoint = new Point(vars.recoilX + 1, vars.recoilY + 1); device.DrawCrosshair(CrosshairStyle.Plus, centralPoint, 7, 1f, _greenBrush); for (int i = 0; i < Config.numberOfPlayers; i++) { if (Lists.team[i] == 2) { _emptyBrush = _redBrush; } else { _emptyBrush = _greenBrush; }; if (Lists.dormant[i] == 1) { _emptyBrush = _yellowBrush; } if (Lists.health[i] > 0 && vars.localClass.LocalPlayer != Lists.entityID[i] && Lists.entityID[i] != Lists.observer[i] && Lists.selectedBoneX[i] != 0) { device.OutlineCircle(Lists.selectedBoneX[i], Lists.selectedBoneY[i], Lists.distance[i] + 0.1f, 2.0f, _emptyBrush, _blackBrush); } } } }
private void _frameTimer_OnFrame(FrameTimer timer, D2DDevice device) { #region non drawing things D2DSolidColorBrush GetDXColor(Color color) { return(device.CreateSolidColorBrush(color.R, color.G, color.B, color.A)); } if (!device.IsDrawing) { _initializeGraphicObjects = true; return; } device.ClearScene(); #endregion DrawTextWithBackground("ZBase", 0, 0, 16, Color.Blue, Color.DimGray); if (Main.S.ESP) { foreach (Entity Player in Globals.EntityList) { if (Player.EntityBase != Globals.LocalPlayer.EntityBase) { Vector2 Player2DPos = Tools.WorldToScreen(Player.Position); Vector2 Player2DHeadPos = Tools.WorldToScreen(Player.HeadPosition); Vector2 Player2DNeckPos = Tools.WorldToScreen(Player.GetBonePosition(7)); if (!Tools.IsNullVector2(Player2DPos) && !Tools.IsNullVector2(Player2DHeadPos) && Player.Valid) { float FromHeadToNeck = (Player2DNeckPos.Y - Player2DHeadPos.Y); Player2DHeadPos.Y -= FromHeadToNeck * 2.3f; Player2DPos.Y += FromHeadToNeck; float BoxHeight = Player2DPos.Y - Player2DHeadPos.Y; float BoxWidth = (BoxHeight / 2); //wierd ass calculations for box height, dont judge Color drawcolor; if (Player.IsTeammate) { drawcolor = Color.Blue; } else { drawcolor = Color.Red; } DrawOutlineBox(Player2DPos.X - (BoxWidth / 2), Player2DHeadPos.Y, BoxWidth, BoxHeight, drawcolor); DrawLine(Main.MidScreen.X, Main.MidScreen.Y + Main.MidScreen.Y, Player2DPos.X, Player2DPos.Y, drawcolor); } } } } #region drawing functions void DrawBoxEdge(float x, float y, float width, float height, Color color, float thiccness = 2.0f) { device.DrawRectangleEdges(Rectangle.Create(x, y, width, height), thiccness, GetDXColor(color)); } void DrawText(string text, float x, float y, int size, Color color, bool bold = false, bool italic = false) { D2DFont f = _device.CreateFont(new FontOptions() { Bold = bold, FontFamilyName = "Arial", FontSize = size, Italic = italic, WordWrapping = true }); device.DrawText(text, new Point(x, y), f, GetDXColor(color)); } void DrawTextWithBackground(string text, float x, float y, int size, Color color, Color backcolor, bool bold = false, bool italic = false) { D2DFont f = _device.CreateFont(new FontOptions() { Bold = bold, FontFamilyName = "Arial", FontSize = size, Italic = italic, WordWrapping = true }); device.DrawTextWithBackground(text, new Point(x, y), f, GetDXColor(color), GetDXColor(backcolor)); } void DrawLine(float fromx, float fromy, float tox, float toy, Color color, float thiccness = 2.0f) { device.DrawLine(fromx, fromy, tox, toy, thiccness, GetDXColor(color)); } void DrawFilledRectangle(float x, float y, float width, float height, Color color) { device.FillRectangle(Rectangle.Create(x, y, width, height), GetDXColor(color)); } void DrawCircle(float x, float y, float radius, Color color) { device.DrawCircle(new Circle(x, y, radius), 1, GetDXColor(color)); } void DrawCrosshair(CrosshairStyle style, float x, float y, float size, float stroke, Color color) { device.DrawCrosshair(style, new Point(x, y), size, stroke, GetDXColor(color)); } void DrawBox(float x, float y, float width, float height, Color color, float thiccness = 2.0f) { device.DrawRectangle(Rectangle.Create(x, y, width, height), thiccness, GetDXColor(color)); } void DrawOutlineBox(float x, float y, float width, float height, Color color, float thiccness = 2.0f) { device.OutlineRectangle(Rectangle.Create(x, y, width, height), thiccness, GetDXColor(color), GetDXColor(Color.Black)); } void DrawRoundedBox(float x, float y, float width, float height, float radius, Color color, float thiccness = 2.0f) { device.DrawRoundedRectangle(RoundedRectangle.Create(x, y, width, height, radius), thiccness, GetDXColor(color)); } #endregion }
private void _frameTimer_OnFrame(FrameTimer timer, D2DDevice device) { // the render loop will call device.BeginScene() and device.EndScene() for us if (!device.IsDrawing) { _initializeGraphicObjects = true; return; } // clear the scene / fill it with our background device.ClearScene(_backgroundColor); if (!CanDraw) { return; } // text // the background is dynamically adjusted to the text's size var esp = Program.IsEspEnabled ? '+' : '-'; var radar = Program.IsRadarEnabled ? '+' : '-'; var trigger = Program.IsTriggerBot ? '+' : '-'; var aim = Program.IsAimEnabled ? '+' : '-'; var cross = Program.IsCrosshairDraw ? '+' : '-'; var bunny = Program.IsBunnyHopEnabled ? '+' : '-'; device.DrawTextWithBackground( $"Fps: {device.FramesPerSecond} [ Esp(F5): {esp} ] [ Radar(F6): {radar} ] [ Trigger(F7): {trigger} ] [ Aim(F8): {aim} ] [ Cross(F9): {cross} ] [ Bunny(F10): {bunny} ]", 10, 50, _font, _redBrush, _blackBrush); if (IsInGame()) { if (LocalPlayer == null) { return; } device.DrawTextWithBackground( $"Me: (Map: {_mapName}) {Closed?.Name} {LocalPlayer.Health} {LocalPlayer.Team} {LocalPlayer.Position} Max:{MaxPlayersOnMap}", 10, 80, _font, _redBrush, _blackBrush); if (Program.IsCrosshairDraw) { device.FillCircle(_sizeX / 2f, _sizeY / 2f, Fov, _blueBrush); device.DrawCrosshair(CrosshairStyle.Plus, new Point(_sizeX / 2f, _sizeY / 2f), 15, 1, _blackBrush); } foreach (var justEntity in ListOfGlow.ToList()) { try { var w2S = justEntity.W2SPosition; if (w2S.X <= 0 || w2S.Y <= 0 || w2S.X >= Program.ScreenSize.X || w2S.Y >= Program.ScreenSize.Y) { continue; } /*if (Program.IsEspEnabled) * { * var classId = justEntity.ClassId; * * device.DrawTextWithBackground($"[{classId}]", w2S.X, w2S.Y, _font, _redBrush, * _blackBrush); * }*/ } catch (Exception e) { } } } else { device.DrawTextWithBackground($"Not in game", 10, 70, _font, _redBrush, _blackBrush); } return; // primitives device.DrawCircle(100, 100, 50, 2.0f, _redBrush); device.DrawDashedCircle(250, 100, 50, 2.0f, _greenBrush); // Rectangle.Create offers a method to create rectangles with x, y, width, heigth device.DrawRectangle(Rectangle.Create(350, 50, 100, 100), 2.0f, _blueBrush); device.DrawRoundedRectangle(RoundedRectangle.Create(500, 50, 100, 100, 6.0f), 2.0f, _redBrush); device.DrawTriangle(650, 150, 750, 150, 700, 50, _greenBrush, 2.0f); // lines device.DrawLine(50, 175, 750, 175, 2.0f, _blueBrush); device.DrawDashedLine(50, 200, 750, 200, 2.0f, _redBrush); // outlines & filled device.OutlineCircle(100, 275, 50, 4.0f, _redBrush, _blackBrush); device.FillCircle(250, 275, 50, _greenBrush); device.OutlineRectangle(Rectangle.Create(350, 225, 100, 100), 4.0f, _blueBrush, _blackBrush); _gradient.SetRange(500, 225, 600, 325); device.FillRoundedRectangle(RoundedRectangle.Create(500, 225, 100, 100, 6.0f), _gradient); device.FillTriangle(650, 325, 750, 325, 700, 225, _greenBrush); // images //device.DrawImage(_image, 310, 375); }