public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); float fontSize = (float)Math.Ceiling(this.Font.FontSize); Vector2 size = renderer.MeasureString(this.Text, this.Font); if (!this.FillParent) this.Width = size.X + fontSize; this.Height = size.Y; Vector2 location = this.GetAbsoluteLocation(); Vector2 box = new Vector2(fontSize, fontSize); Vector2 boxLocation = new Vector2(location.X, location.Y + this.Height / 2f - box.Y / 2f); if(this.MouseOver) renderer.FillRectangle(this.BackColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(this.Width + MarginLeft + MarginRight, this.Height + MarginTop + MarginBottom)); renderer.DrawRectangle(this.ForeColor, boxLocation, box); if (this.Checked) renderer.FillRectangle(this.ForeColor, boxLocation + Vector2.One * 2, box - Vector2.One * 4); renderer.DrawText(this.Text, this.ForeColor, this.Font, new Vector2(location.X + box.X + MarginLeft, location.Y)); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); Vector2 marginLocation = location - Vector2.UnitX * this.MarginLeft - Vector2.UnitY * this.MarginTop; Vector2 marginSize = size + Vector2.UnitX * this.MarginLeft + Vector2.UnitX * this.MarginRight + Vector2.UnitY * this.MarginTop + Vector2.UnitY * this.MarginBottom; //renderer.FillRectangle(this.BackColor, marginLocation, marginSize); //renderer.DrawRectangle(this.ForeColor, marginLocation, marginSize); string text = string.Format("{0} {1}", this.Text, Math.Round(this.value, this.NumberOfDecimals)); Vector2 textSize = renderer.MeasureString(text, this.Font); renderer.DrawText(text, this.ForeColor, this.Font, location); trackbarLocation = location + Vector2.UnitY * textSize.Y; Vector2 trackBarHandleSize = new Vector2(TrackbarHeight, TrackbarHeight); trackbarLocation = location + Vector2.UnitY * (textSize.Y + MarginTop + TrackbarHeight / 2f) + Vector2.UnitX * TrackbarHeight / 2f; Vector2 trackbarSize = new Vector2(size.X - TrackbarHeight, 0); Vector2 trackbarMarkerLocation = new Vector2(trackbarLocation.X + trackbarSize.X * Percent, trackbarLocation.Y); Vector2 trackbarMarkerSize = new Vector2(TrackbarHeight / 4f, TrackbarHeight); renderer.DrawLine(this.ForeColor, trackbarLocation, trackbarLocation + trackbarSize, TrackbarHeight / 4f + 2f); renderer.DrawLine(this.BackColor, trackbarLocation, trackbarLocation + trackbarSize, TrackbarHeight / 4f); renderer.FillRectangle(this.ForeColor, trackbarMarkerLocation - (trackbarMarkerSize + 2f) / 2f, trackbarMarkerSize + 2f); renderer.FillRectangle(this.BackColor, trackbarMarkerLocation - trackbarMarkerSize / 2f, trackbarMarkerSize); this.Height = textSize.Y + TrackbarHeight + MarginTop + MarginBottom; base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); renderer.FillRectangle(this.BackColor, location, size); renderer.DrawRectangle(this.ForeColor, location, size); Vector2[] points = new Vector2[NumberOfValues]; long max = DynamicMaximum ? this.Values.Max() : this.Maximum; for (int i = 0; i < points.Length; i++) { points[i] = location + new Vector2(this.Width / (points.Length - 1) * i, this.Height - (this.Height - this.MarginTop - this.MarginBottom) / max * this.Values[i]); } renderer.DrawLines(this.ForeColor, points); string maxString = MiscUtils.GetUnitFromSize(max, true); Vector2 maxSize = renderer.MeasureString(maxString, this.Font); Vector2 maxLocation = location + new Vector2(this.Width - maxSize.X, 0); renderer.DrawText(maxString, this.ForeColor, this.Font, maxLocation); renderer.DrawText(this.Text, this.ForeColor, this.Font, location); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); float fontSize = (float)Math.Ceiling(this.Font.FontSize); Vector2 size = renderer.MeasureString(this.Text, this.Font); if (!this.FillParent) { this.Width = size.X + fontSize; } this.Height = size.Y; Vector2 location = this.GetAbsoluteLocation(); Vector2 box = new Vector2(fontSize, fontSize); Vector2 boxLocation = new Vector2(location.X, location.Y + this.Height / 2f - box.Y / 2f); if (this.MouseOver) { renderer.FillRectangle(this.BackColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(this.Width + MarginLeft + MarginRight, this.Height + MarginTop + MarginBottom)); } renderer.DrawRectangle(this.ForeColor, boxLocation, box); if (this.Checked) { renderer.FillRectangle(this.ForeColor, boxLocation + Vector2.One * 2, box - Vector2.One * 4); } renderer.DrawText(this.Text, this.ForeColor, this.Font, new Vector2(location.X + box.X + MarginLeft, location.Y)); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); Vector2 location = this.GetAbsoluteLocation(); float distance = this.Width / 2f + this.Spread * this.SpreadScale; switch (Type) { case Types.Default: for (int i = 0; i < 4; i++) DrawLine(renderer, location, distance, this.Radius, i * 90f, this.Width, this.Outline); break; case Types.DefaultTilted: for (int i = 0; i < 4; i++) DrawLine(renderer, location, distance, this.Radius, i * 90f + 45f, this.Width, this.Outline); break; case Types.Rectangle: for (int i = 0; i < 4; i++) DrawCrossLine(renderer, location, distance, this.Radius, i * 90f + 45f, this.Width, this.Outline); break; case Types.RectangleTilted: for (int i = 0; i < 4; i++) DrawCrossLine(renderer, location, distance, this.Radius, i * 90f, this.Width, this.Outline); break; case Types.Circle: float length = (this.Radius + this.Spread * this.SpreadScale) * 2f; Vector2 size = new Vector2(length, length); if (this.Outline) renderer.DrawEllipse(this.SecondaryColor, location, size, true, this.Width + 2f); renderer.DrawEllipse(this.PrimaryColor, location, size, true, this.Width); break; } }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); float fontSize = (float)Math.Ceiling(this.Font.FontSize); Vector2 size = renderer.MeasureString(this.Text, this.Font); if (!this.FillParent && !this.FixedWidth) { this.Width = size.X; } this.Height = size.Y; Vector2 location = this.GetAbsoluteLocation(); switch (this.TextAlign) { case TextAlignment.Center: location.X += this.Width / 2f - size.X / 2f; break; case TextAlignment.Right: location.X += this.Width - size.X; break; } renderer.DrawText(this.Text, this.ForeColor, this.Font, new Vector2(location.X + MarginLeft, location.Y)); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 boxLocation = new Vector2(location.X - this.MarginLeft, location.Y - this.MarginTop); Vector2 boxSize = new Vector2(this.Width + this.MarginLeft + this.MarginRight, this.Height + this.MarginBottom + this.MarginTop); renderer.FillRectangle(this.BackColor, boxLocation, boxSize); renderer.DrawRectangle(this.ForeColor, boxLocation, boxSize); Vector2 textLocation = location + Vector2.UnitX * this.MarginLeft * 2 + Vector2.UnitY * this.MarginTop; Vector2 textSize = renderer.MeasureString(this.Text, this.Font); renderer.DrawText(this.Text, this.ForeColor, this.Font, textLocation); Vector2 spacerLocation = location + Vector2.UnitY * textSize.Y + this.MarginTop * 3 * Vector2.UnitY - Vector2.UnitY * this.MarginLeft; Vector2 spacerSize = new Vector2(this.Width, 2f); renderer.FillRectangle(this.ForeColor, spacerLocation, spacerSize); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); if (this.ChildControls.Count == 0) return; TabHeaders = new RectangleF[ChildControls.Count]; int idx = 0; Vector2 location = this.GetAbsoluteLocation(); foreach (SharpDXControl panel in ChildControls) { Vector2 size = renderer.MeasureString(panel.Text, this.Font); if (idx == 0) TabHeaders[idx] = new RectangleF(0, 0, (float)Math.Max(MinimumHeaderWidth, size.X + this.MarginLeft + this.MarginRight), size.Y); else TabHeaders[idx] = new RectangleF(TabHeaders[idx - 1].X + TabHeaders[idx - 1].Width, TabHeaders[idx - 1].Y, (float)Math.Max(MinimumHeaderWidth, size.X + this.MarginLeft + this.MarginRight), size.Y); Vector2 tabLocation = location + new Vector2(TabHeaders[idx].X, TabHeaders[idx].Y); renderer.FillRectangle(this.BackColor, tabLocation, new Vector2(TabHeaders[idx].Width, TabHeaders[idx].Height)); if (this.SelectedIndex == idx) renderer.FillRectangle(this.ForeColor * 0.1f, tabLocation, new Vector2(TabHeaders[idx].Width, TabHeaders[idx].Height)); renderer.DrawRectangle(this.ForeColor, tabLocation, new Vector2(TabHeaders[idx].Width, TabHeaders[idx].Height)); renderer.DrawText(panel.Text, this.ForeColor, this.Font, tabLocation + Vector2.UnitX * this.MarginLeft); idx++; } }
static void Main(string[] args) { Console.WriteLine("Change overlay attached window by pressing F5"); Console.WriteLine("It will attach to currently active window"); Console.WriteLine("Trackbar can be controled with mouse wheel"); System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); input = new InputUtilities(); var hWnd = WinAPI.GetForegroundWindow(); using (SHDXOverlay = new SharpDXOverlay()) { SHDXOverlay.Attach(hWnd); SHDXOverlay.TickEvent += overlay_TickEvent; InitializeComponents(); SharpDXRenderer renderer = SHDXOverlay.Renderer; TextFormat smallFont = renderer.CreateFont("smallFont", "Century Gothic", 10f); TextFormat largeFont = renderer.CreateFont("largeFont", "Century Gothic", 14f); TextFormat heavyFont = renderer.CreateFont("heavyFont", "Century Gothic", 14f, SharpDX.DirectWrite.FontStyle.Normal, FontWeight.Heavy); windowMenu.Font = smallFont; windowMenu.Caption.Font = largeFont; SHDXOverlay.ChildControls.Add(windowMenu); System.Windows.Forms.Application.Run(SHDXOverlay); } }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); if(this.MouseOver || this.DrawBackground) renderer.FillRectangle(this.BackColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(size.X + MarginLeft + MarginRight, size.Y + MarginTop + MarginBottom)); if(this.DrawBorder) renderer.DrawRectangle(this.ForeColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(size.X + MarginLeft + MarginRight, size.Y + MarginTop + MarginBottom)); float fontSize = (float)Math.Ceiling(this.Font.FontSize); Vector2 textSize = renderer.MeasureString(this.Text, this.Font); this.Height = textSize.Y; switch (this.TextAlign) { case TextAlignment.Center: location.X += this.Width / 2f - textSize.X / 2f; break; case TextAlignment.Right: location.X += this.Width - textSize.X; break; } renderer.DrawText(this.Text, this.ForeColor, this.Font, new Vector2(location.X + MarginLeft, location.Y)); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); Vector2 controlCenter = location + size / 2f; Vector2 dotSize = new Vector2(DotRadius * 2, DotRadius * 2); //Background renderer.FillRectangle(this.BackColor, location, size); renderer.DrawRectangle(this.ForeColor, location, size); //Zoom renderer.DrawText(string.Format("Zoom: {0}", Math.Round(Scaling, 4)), this.ForeColor, this.Font, location); //Grid renderer.DrawLine(this.ForeColor, location + Vector2.UnitX * size.X / 2f, location + Vector2.UnitX * size.X / 2f + Vector2.UnitY * size.Y); renderer.DrawLine(this.ForeColor, location + Vector2.UnitY * size.Y / 2f, location + Vector2.UnitY * size.Y / 2f + Vector2.UnitX * size.X); //Enemies if (Enemies != null) foreach (Vector2 coord in Enemies) DrawDot(renderer, coord, EnemiesColor, controlCenter, dotSize); //Allies if (Allies != null) foreach (Vector2 coord in Allies) DrawDot(renderer, coord, AlliesColor, controlCenter, dotSize); //Center renderer.FillEllipse(this.ForeColor, controlCenter, dotSize, true); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { renderer.FillRectangle( this.ForeColor, this.GetAbsoluteLocation(), this.GetSize()); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); Vector2 location = this.GetAbsoluteLocation(); float length = (this.Radius + this.Spread * this.SpreadScale) * 2f; Vector2 size = new Vector2(length, length); if (this.Outline) renderer.DrawEllipse(this.SecondaryColor, location, size, true, this.Width + 2f); renderer.DrawEllipse(this.PrimaryColor, location, size, true, this.Width); }
public override void Draw(SharpDXRenderer renderer) { string text = null; string orig = this.Text; if (listen) text = string.Format("{0} <press key>", this.Text); else text = string.Format("{0} {1}", this.Text, this.Key); this.Text = text; base.Draw(renderer); this.Text = orig; }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); Vector2 location = this.GetAbsoluteLocation(); float length = (this.Radius + this.Spread * this.SpreadScale) * 2f; Vector2 size = new Vector2(length, length); if (this.Outline) { renderer.DrawEllipse(this.SecondaryColor, location, size, true, this.Width + 2f); } renderer.DrawEllipse(this.PrimaryColor, location, size, true, this.Width); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); Vector2 fillSize = new Vector2(size.X * (this.Value / this.Maximum), size.Y); renderer.FillRectangle(this.BackColor, location, size); renderer.FillRectangle(this.FillColor, location, fillSize); renderer.DrawRectangle(this.ForeColor, location, size); this.FillParent = true; base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 boxLocation = new Vector2(location.X - this.MarginLeft, location.Y - this.MarginTop); Vector2 boxSize = new Vector2(this.Width + this.MarginLeft + this.MarginRight, this.Height + this.MarginBottom + this.MarginTop); renderer.FillRectangle(this.BackColor, boxLocation, boxSize); renderer.DrawRectangle(this.ForeColor, boxLocation, boxSize); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); Vector2 location = this.GetAbsoluteLocation(); float distance = this.Width / 2f + this.Spread * this.SpreadScale; switch (Type) { case Types.Default: for (int i = 0; i < 4; i++) { DrawLine(renderer, location, distance, this.Radius, i * 90f, this.Width, this.Outline); } break; case Types.DefaultTilted: for (int i = 0; i < 4; i++) { DrawLine(renderer, location, distance, this.Radius, i * 90f + 45f, this.Width, this.Outline); } break; case Types.Rectangle: for (int i = 0; i < 4; i++) { DrawCrossLine(renderer, location, distance, this.Radius, i * 90f + 45f, this.Width, this.Outline); } break; case Types.RectangleTilted: for (int i = 0; i < 4; i++) { DrawCrossLine(renderer, location, distance, this.Radius, i * 90f, this.Width, this.Outline); } break; case Types.Circle: float length = (this.Radius + this.Spread * this.SpreadScale) * 2f; Vector2 size = new Vector2(length, length); if (this.Outline) { renderer.DrawEllipse(this.SecondaryColor, location, size, true, this.Width + 2f); } renderer.DrawEllipse(this.PrimaryColor, location, size, true, this.Width); break; } }
protected void DrawLine(SharpDXRenderer renderer, Vector2 center, float distance, float length, float angle, float width, bool outline) { ExternalUtilsCSharp.MathObjects.Vector2 vecCenter = SharpDXConverter.Vector2SDXtoEUC(center); ExternalUtilsCSharp.MathObjects.Vector2 vecRotateA = new MathObjects.Vector2(vecCenter.X + distance, vecCenter.Y); ExternalUtilsCSharp.MathObjects.Vector2 vecRotateB = new MathObjects.Vector2(vecCenter.X + distance + length, vecCenter.Y); vecRotateA = ExternalUtilsCSharp.MathUtils.RotatePoint(vecRotateA, vecCenter, angle); vecRotateB = ExternalUtilsCSharp.MathUtils.RotatePoint(vecRotateB, vecCenter, angle); Vector2 _vecRotateA = SharpDXConverter.Vector2EUCtoSDX(vecRotateA); Vector2 _vecRotateB = SharpDXConverter.Vector2EUCtoSDX(vecRotateB); if (outline) { renderer.DrawLine(this.SecondaryColor, _vecRotateA, _vecRotateB, width + 2f); } renderer.DrawLine(this.PrimaryColor, _vecRotateA, _vecRotateB, width); }
public override void Draw(SharpDXRenderer renderer) { string text = null; string orig = this.Text; if (listen) { text = string.Format("{0} <press key>", this.Text); } else { text = string.Format("{0} {1}", this.Text, this.Key); } this.Text = text; base.Draw(renderer); this.Text = orig; }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); //Vector2 rightHalf = new Vector2(this.Width / 2f, 0); ////Right half of the window //renderer.DrawRectangle( // this.ForeColor, // rightHalf, // new Vector2(this.Width /2f, this.Height)); ////Levelbar //renderer.DrawRectangle( // this.ForeColor, // new Vector2(this.Width / 2f, 0), // new Vector2(this.Width / 2f, this.Width * 0.0675f)); //Levelbar items Vector2 item = new Vector2(this.Width * 0.0375f); Vector2 itemWidth = new Vector2(this.Width * 0.0375f, 0); Vector2 itemY = new Vector2(0, this.Width * 0.020f); Vector2 itemDistance = new Vector2(this.Width * 0.020f, 0); renderer.DrawRectangle( this.ForeColor, new Vector2(this.Width * 0.75f - item.X / 2f, this.Width * 0.020f), item); renderer.DrawRectangle( this.ForeColor, new Vector2(this.Width * 0.75f - item.X / 2f, 0) + itemY - itemDistance - itemWidth, item); renderer.DrawRectangle( this.ForeColor, new Vector2(this.Width * 0.75f - item.X / 2f, 0) + itemY - itemDistance * 2f - itemWidth * 2f, item); renderer.DrawRectangle( this.ForeColor, new Vector2(this.Width * 0.75f - item.X / 2f, 0) + itemY + itemDistance + itemWidth, item); ////Click-area //Vector2 areaSize = new Vector2(this.Width / 2f * 0.6f, this.Width * 0.15f); //Vector2 location = new Vector2(this.Width / 4f, this.Width / 2f * 0.7f); //renderer.DrawRectangle( // this.ForeColor, // rightHalf + location - areaSize / 2f, // areaSize); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = renderer.MeasureString(this.Text, this.Font); if (!this.FillParent && !this.FixedWidth) this.Width = size.X; if(this.MouseOver) renderer.FillRectangle(this.BackColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(this.Width + MarginLeft + MarginRight, this.Height + MarginTop + MarginBottom)); base.Draw(renderer); renderer.DrawRectangle(this.ForeColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(this.Width + MarginLeft + MarginRight, this.Height + MarginTop + MarginBottom)); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); if (this.MouseOver) { renderer.FillRectangle(this.BackColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(size.X + MarginLeft + MarginRight, size.Y + MarginTop + MarginBottom)); } renderer.DrawRectangle(this.ForeColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(size.X + MarginLeft + MarginRight, size.Y + MarginTop + MarginBottom)); float fontSize = (float)Math.Ceiling(this.Font.FontSize); string display = string.Format("{0}: {1}", this.Text, this.Values != null ? this.Values[this.SelectedIndex].Item1 : "<none>"); Vector2 textSize = renderer.MeasureString(display, this.Font); Vector2 textLocation = location; this.Height = textSize.Y; switch (this.TextAlign) { case TextAlignment.Center: textLocation.X += this.Width / 2f - textSize.X / 2f; break; case TextAlignment.Right: textLocation.X += this.Width - textSize.X; break; } renderer.DrawText(display, this.ForeColor, this.Font, new Vector2(textLocation.X + MarginLeft, textLocation.Y)); renderer.DrawText("<", this.ForeColor, this.Font, location); textSize = renderer.MeasureString(">", this.Font); textLocation = location + Vector2.UnitX * size.X - Vector2.UnitX * textSize.X; renderer.DrawText(">", this.ForeColor, this.Font, textLocation); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 boxLocation = new Vector2(location.X - this.MarginLeft, location.Y - this.MarginTop); Vector2 boxSize = new Vector2(this.Width + this.MarginLeft + this.MarginRight, this.Height + this.MarginBottom + this.MarginTop); if (this.DrawBackground) { renderer.FillRectangle(this.BackColor, boxLocation, boxSize); } if (this.DrawBackground) { renderer.DrawRectangle(this.ForeColor, boxLocation, boxSize); } base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { Vector2 center = this.LastCursorPoint; Vector2 right = this.LastCursorPoint + Vector2.UnitX * this.Width; Vector2 left = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint( SharpDXConverter.Vector2SDXtoEUC(right), SharpDXConverter.Vector2SDXtoEUC(center), Angle)); right = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint( SharpDXConverter.Vector2SDXtoEUC(right), SharpDXConverter.Vector2SDXtoEUC(center), AngleRotation)); left = SharpDXConverter.Vector2EUCtoSDX(MathUtils.RotatePoint( SharpDXConverter.Vector2SDXtoEUC(left), SharpDXConverter.Vector2SDXtoEUC(center), AngleRotation)); renderer.FillPolygon(this.BackColor, left, center, right); renderer.DrawPolygon(this.ForeColor, left, center, right); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); if (this.ChildControls.Count == 0) { return; } TabHeaders = new RectangleF[ChildControls.Count]; int idx = 0; Vector2 location = this.GetAbsoluteLocation(); foreach (SharpDXControl panel in ChildControls) { Vector2 size = renderer.MeasureString(panel.Text, this.Font); if (idx == 0) { TabHeaders[idx] = new RectangleF(0, 0, (float)Math.Max(MinimumHeaderWidth, size.X + this.MarginLeft + this.MarginRight), size.Y); } else { TabHeaders[idx] = new RectangleF(TabHeaders[idx - 1].X + TabHeaders[idx - 1].Width, TabHeaders[idx - 1].Y, (float)Math.Max(MinimumHeaderWidth, size.X + this.MarginLeft + this.MarginRight), size.Y); } Vector2 tabLocation = location + new Vector2(TabHeaders[idx].X, TabHeaders[idx].Y); renderer.FillRectangle(this.BackColor, tabLocation, new Vector2(TabHeaders[idx].Width, TabHeaders[idx].Height)); if (this.SelectedIndex == idx) { renderer.FillRectangle(this.ForeColor * 0.1f, tabLocation, new Vector2(TabHeaders[idx].Width, TabHeaders[idx].Height)); } renderer.DrawRectangle(this.ForeColor, tabLocation, new Vector2(TabHeaders[idx].Width, TabHeaders[idx].Height)); renderer.DrawText(panel.Text, this.ForeColor, this.Font, tabLocation + Vector2.UnitX * this.MarginLeft); idx++; } }
protected virtual void DrawDot(SharpDXRenderer renderer, Vector2 coordinate, Color color, Vector2 controlCenter, Vector2 dotSize) { Vector2 delta = (coordinate - CenterCoordinate) * Scaling; delta.X *= -1; if (Rotating) { delta = SharpDXConverter.Vector2EUCtoSDX( MathUtils.RotatePoint( SharpDXConverter.Vector2SDXtoEUC(delta), ExternalUtilsCSharp.MathObjects.Vector2.Zero, RotationDegrees)); } if (Math.Abs(delta.X) + DotRadius > this.Width / 2f) { if (delta.X > 0) { delta.X = this.Width / 2f - DotRadius; } else { delta.X = -this.Width / 2f + DotRadius; } } if (Math.Abs(delta.Y) + DotRadius > this.Height / 2f) { if (delta.Y > 0) { delta.Y = this.Height / 2f - DotRadius; } else { delta.Y = -this.Height / 2f + DotRadius; } } renderer.FillEllipse(color, controlCenter + delta, dotSize, true); renderer.DrawEllipse(this.ForeColor, controlCenter + delta, dotSize, true); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); if (this.MouseOver || this.DrawBackground) { renderer.FillRectangle(this.BackColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(size.X + MarginLeft + MarginRight, size.Y + MarginTop + MarginBottom)); } if (this.DrawBorder) { renderer.DrawRectangle(this.ForeColor, new Vector2(location.X - MarginLeft, location.Y - MarginTop), new Vector2(size.X + MarginLeft + MarginRight, size.Y + MarginTop + MarginBottom)); } float fontSize = (float)Math.Ceiling(this.Font.FontSize); Vector2 textSize = renderer.MeasureString(this.Text, this.Font); this.Height = textSize.Y; switch (this.TextAlign) { case TextAlignment.Center: location.X += this.Width / 2f - textSize.X / 2f; break; case TextAlignment.Right: location.X += this.Width - textSize.X; break; } renderer.DrawText(this.Text, this.ForeColor, this.Font, new Vector2(location.X + MarginLeft, location.Y)); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { //Vector2 location = this.GetAbsoluteLocation(); //Vector2 boxLocation = new Vector2(location.X - this.MarginLeft, location.Y - this.MarginTop); //Vector2 boxSize = new Vector2(this.Width + this.MarginLeft + this.MarginRight, this.Height + this.MarginBottom + this.MarginTop); //renderer.FillRectangle(this.BackColor, // boxLocation, // boxSize); //renderer.DrawRectangle(this.ForeColor, // boxLocation, // boxSize); //Vector2 textLocation = location + Vector2.UnitX * this.MarginLeft * 2 + Vector2.UnitY * this.MarginTop; //Vector2 textSize = renderer.MeasureString(this.Text, this.Font); //renderer.DrawText(this.Text, this.ForeColor, this.Font, textLocation); //Vector2 spacerLocation = location + Vector2.UnitY * textSize.Y + this.MarginTop * 3 * Vector2.UnitY - Vector2.UnitY * this.MarginLeft; //Vector2 spacerSize = new Vector2(this.Width, 2f); //renderer.FillRectangle(this.ForeColor, spacerLocation, spacerSize); base.Draw(renderer); }
public override void Draw(SharpDXRenderer renderer) { base.Draw(renderer); float fontSize = (float)Math.Ceiling(this.Font.FontSize); Vector2 size = renderer.MeasureString(this.Text, this.Font); if (!this.FillParent && !this.FixedWidth) this.Width = size.X; this.Height = size.Y; Vector2 location = this.GetAbsoluteLocation(); switch (this.TextAlign) { case TextAlignment.Center: location.X += this.Width / 2f - size.X / 2f; break; case TextAlignment.Right: location.X += this.Width - size.X; break; } renderer.DrawText(this.Text, this.ForeColor, this.Font, new Vector2(location.X + MarginLeft, location.Y)); }
public override void Draw(SharpDXRenderer renderer) { Vector2 location = this.GetAbsoluteLocation(); Vector2 size = this.GetSize(); Vector2 controlCenter = location + size / 2f; Vector2 dotSize = new Vector2(DotRadius * 2, DotRadius * 2); //Background renderer.FillRectangle(this.BackColor, location, size); renderer.DrawRectangle(this.ForeColor, location, size); //Zoom renderer.DrawText(string.Format("Zoom: {0}", Math.Round(Scaling, 4)), this.ForeColor, this.Font, location); //Grid renderer.DrawLine(this.ForeColor, location + Vector2.UnitX * size.X / 2f, location + Vector2.UnitX * size.X / 2f + Vector2.UnitY * size.Y); renderer.DrawLine(this.ForeColor, location + Vector2.UnitY * size.Y / 2f, location + Vector2.UnitY * size.Y / 2f + Vector2.UnitX * size.X); //Enemies if (Enemies != null) { foreach (Vector2 coord in Enemies) { DrawDot(renderer, coord, EnemiesColor, controlCenter, dotSize); } } //Allies if (Allies != null) { foreach (Vector2 coord in Allies) { DrawDot(renderer, coord, AlliesColor, controlCenter, dotSize); } } //Center renderer.FillEllipse(this.ForeColor, controlCenter, dotSize, true); base.Draw(renderer); }
protected void DrawLine(SharpDXRenderer renderer, Vector2 center, float distance, float length, float angle, float width, bool outline) { ExternalUtilsCSharp.MathObjects.Vector2 vecCenter = SharpDXConverter.Vector2SDXtoEUC(center); ExternalUtilsCSharp.MathObjects.Vector2 vecRotateA = new MathObjects.Vector2(vecCenter.X + distance, vecCenter.Y); ExternalUtilsCSharp.MathObjects.Vector2 vecRotateB = new MathObjects.Vector2(vecCenter.X + distance + length, vecCenter.Y); vecRotateA = ExternalUtilsCSharp.MathUtils.RotatePoint(vecRotateA, vecCenter, angle); vecRotateB = ExternalUtilsCSharp.MathUtils.RotatePoint(vecRotateB, vecCenter, angle); Vector2 _vecRotateA = SharpDXConverter.Vector2EUCtoSDX(vecRotateA); Vector2 _vecRotateB = SharpDXConverter.Vector2EUCtoSDX(vecRotateB); if (outline) renderer.DrawLine(this.SecondaryColor, _vecRotateA, _vecRotateB, width + 2f); renderer.DrawLine(this.PrimaryColor, _vecRotateA, _vecRotateB, width); }
public static void Main(string[] args) { System.Windows.Forms.Application.EnableVisualStyles(); System.Windows.Forms.Application.SetCompatibleTextRenderingDefault(false); PrintSuccess("[>]=-- Zat's CSGO-ESP"); PrintEncolored("[www.unknowncheats.me - Leading the game hacking scene since 2000]", ConsoleColor.Cyan); Thread scroller = new Thread(new ThreadStart(LoopScroll)); scroller.IsBackground = true; scroller.Start(); KeyUtils = new KeyUtils(); ConfigUtils = new CSGOConfigUtils(); //ESP ConfigUtils.BooleanSettings.AddRange(new string[] { "espEnabled", "espBox", "espSkeleton", "espName", "espHealth", "espAllies", "espEnemies" }); //Aim ConfigUtils.BooleanSettings.AddRange(new string[] { "aimDrawFov", "aimEnabled", "aimToggle", "aimHold", "aimSmoothEnabled", "aimFilterSpotted", "aimFilterSpottedBy", "aimFilterEnemies", "aimFilterAllies", "aimFilterSpottedBy" }); ConfigUtils.KeySettings.Add("aimKey"); ConfigUtils.FloatSettings.AddRange(new string[] { "aimFov", "aimSmoothValue" }); ConfigUtils.IntegerSettings.Add("aimBone"); //RCS ConfigUtils.BooleanSettings.Add("rcsEnabled"); ConfigUtils.FloatSettings.Add("rcsForce"); //Trigger ConfigUtils.BooleanSettings.AddRange(new string[] { "triggerEnabled", "triggerToggle", "triggerHold", "triggerFilterEnemies", "triggerFilterAllies", "triggerBurstEnabled", "triggerBurstRandomize" }); ConfigUtils.KeySettings.Add("triggerKey"); ConfigUtils.FloatSettings.AddRange(new string[] { "triggerDelayFirstShot", "triggerDelayShots", "triggerBurstShots" }); //Radar ConfigUtils.BooleanSettings.AddRange(new string[] { "radarEnabled", "radarAllies", "radarEnemies" }); ConfigUtils.FloatSettings.AddRange(new string[] { "radarScale", "radarWidth", "radarHeight" }); //Crosshair ConfigUtils.BooleanSettings.AddRange(new string[] { "crosshairEnabled", "crosshairOutline" }); ConfigUtils.IntegerSettings.AddRange(new string[] { "crosshairType" }); ConfigUtils.UIntegerSettings.AddRange(new string[] { "crosshairPrimaryColor", "crosshairSecondaryColor" }); ConfigUtils.FloatSettings.AddRange(new string[] { "crosshairWidth", "crosshairSpreadScale", "crosshairRadius" }); //Windows ConfigUtils.BooleanSettings.AddRange(new string[] { "windowSpectatorsEnabled", "windowPerformanceEnabled", "windowBotsEnabled", "windowEnemiesEnabled" }); ConfigUtils.FillDefaultValues(); if (!File.Exists("euc_csgo.cfg")) { ConfigUtils.SaveSettingsToFile("euc_csgo.cfg"); } ConfigUtils.ReadSettingsFromFile("euc_csgo.cfg"); PrintInfo("> Waiting for CSGO to start up..."); while (!ProcUtils.ProcessIsRunning(GAME_PROCESS)) { Thread.Sleep(250); } ProcUtils = new ProcUtils(GAME_PROCESS, WinAPI.ProcessAccessFlags.VirtualMemoryRead | WinAPI.ProcessAccessFlags.VirtualMemoryWrite | WinAPI.ProcessAccessFlags.VirtualMemoryOperation); MemUtils = new ExternalUtilsCSharp.MemUtils(); MemUtils.Handle = ProcUtils.Handle; PrintInfo("> Waiting for CSGOs window to show up..."); while ((hWnd = WinAPI.FindWindowByCaption(hWnd, GAME_TITLE)) == IntPtr.Zero) { Thread.Sleep(250); } ProcessModule clientDll, engineDll; PrintInfo("> Waiting for CSGO to load client.dll..."); while ((clientDll = ProcUtils.GetModuleByName(@"bin\client.dll")) == null) { Thread.Sleep(250); } PrintInfo("> Waiting for CSGO to load engine.dll..."); while ((engineDll = ProcUtils.GetModuleByName(@"engine.dll")) == null) { Thread.Sleep(250); } Framework = new Framework(clientDll, engineDll); PrintInfo("> Initializing overlay"); using (SHDXOverlay = new SharpDXOverlay()) { SHDXOverlay.Attach(hWnd); SHDXOverlay.TickEvent += overlay_TickEvent; SHDXOverlay.BeforeDrawingEvent += SHDXOverlay_BeforeDrawingEvent; InitializeComponents(); SharpDXRenderer renderer = SHDXOverlay.Renderer; TextFormat smallFont = renderer.CreateFont("smallFont", "Century Gothic", 10f); TextFormat largeFont = renderer.CreateFont("largeFont", "Century Gothic", 14f); TextFormat heavyFont = renderer.CreateFont("heavyFont", "Century Gothic", 14f, FontStyle.Normal, FontWeight.Heavy); windowMenu.Font = smallFont; windowMenu.Caption.Font = largeFont; windowGraphs.Font = smallFont; windowGraphs.Caption.Font = largeFont; windowSpectators.Font = smallFont; windowSpectators.Caption.Font = largeFont; windowBots.Font = smallFont; windowBots.Caption.Font = largeFont; graphMemRead.Font = smallFont; graphMemWrite.Font = smallFont; for (int i = 0; i < ctrlPlayerESP.Length; i++) { ctrlPlayerESP[i].Font = heavyFont; SHDXOverlay.ChildControls.Add(ctrlPlayerESP[i]); } ctrlRadar.Font = smallFont; windowMenu.ApplySettings(ConfigUtils); SHDXOverlay.ChildControls.Add(ctrlCrosshair); SHDXOverlay.ChildControls.Add(ctrlRadar); SHDXOverlay.ChildControls.Add(windowMenu); SHDXOverlay.ChildControls.Add(windowGraphs); SHDXOverlay.ChildControls.Add(windowSpectators); SHDXOverlay.ChildControls.Add(windowBots); SHDXOverlay.ChildControls.Add(cursor); PrintInfo("> Running overlay"); System.Windows.Forms.Application.Run(SHDXOverlay); } ConfigUtils.SaveSettingsToFile("euc_csgo.cfg"); }
protected virtual void DrawDot(SharpDXRenderer renderer, Vector2 coordinate, Color color, Vector2 controlCenter, Vector2 dotSize) { Vector2 delta = (coordinate - CenterCoordinate) * Scaling; delta.X *= -1; if (Rotating) { delta = SharpDXConverter.Vector2EUCtoSDX( MathUtils.RotatePoint( SharpDXConverter.Vector2SDXtoEUC(delta), ExternalUtilsCSharp.MathObjects.Vector2.Zero, RotationDegrees)); } if (Math.Abs(delta.X) + DotRadius > this.Width / 2f) if (delta.X > 0) delta.X = this.Width / 2f - DotRadius; else delta.X = -this.Width / 2f + DotRadius; if (Math.Abs(delta.Y) + DotRadius > this.Height / 2f) if (delta.Y > 0) delta.Y = this.Height / 2f - DotRadius; else delta.Y = -this.Height / 2f + DotRadius; renderer.FillEllipse(color, controlCenter + delta, dotSize, true); renderer.DrawEllipse(this.ForeColor, controlCenter + delta, dotSize, true); }