/// <summary> /// Renders the tooltip /// </summary> private void RenderToolTip() { var text = $"[i] {this.ToolTip}"; var dim = MiscUtils.MeasureText(text); var width = Math.Max(this.Parent.Width, dim[0] + MenuManager.Instance.Theme.TextSpacing + 15); DefaultMenuTheme.DrawRectangleOutline( this.Position.X, this.Position.Y, width, MenuManager.MaxHeightItem + MenuManager.Instance.Theme.BonusMenuHeight, MenuManager.Instance.Theme.LineWidth, MenuManager.Instance.Theme.LineColor); var position = this.Position + MenuManager.Instance.Theme.LineWidth; Aimtec.Render.Rectangle( position, width - MenuManager.Instance.Theme.LineWidth, MenuManager.MaxHeightItem + MenuManager.Instance.Theme.BonusMenuHeight - MenuManager.Instance.Theme.LineWidth, MenuManager.Instance.Theme.MenuBoxBackgroundColor); var textPosition = new Aimtec.Rectangle((int)position.X, (int)position.Y, (int)(position.X + width - (MenuManager.Instance.Theme.LineWidth)), (int)(position.Y + MenuManager.MaxHeightItem + MenuManager.Instance.Theme.BonusMenuHeight)); Aimtec.Render.Text(text, textPosition, RenderTextFlags.VerticalCenter | RenderTextFlags.NoClip | RenderTextFlags.Center, Color.LightBlue); }
/// <summary> /// Renders the tooltip /// </summary> private void RenderToolTip() { var text = $"[i] {this.ToolTip}"; var width = Math.Max(this.Parent.Width, (int)MiscUtils.MeasureTextWidth(text)); DefaultMenuTheme.DrawRectangleOutline( this.Position.X, this.Position.Y, width, MenuManager.Instance.Theme.MenuHeight, MenuManager.Instance.Theme.LineWidth, MenuManager.Instance.Theme.LineColor); var position = this.Position + MenuManager.Instance.Theme.LineWidth; Aimtec.Render.Rectangle( position, width - MenuManager.Instance.Theme.LineWidth, MenuManager.Instance.Theme.MenuHeight - MenuManager.Instance.Theme.LineWidth, MenuManager.Instance.Theme.MenuBoxBackgroundColor); var centerPoint = this.Position + new Vector2( width - MenuManager.Instance.Theme.LineWidth * 2 / 2, MenuManager.Instance.Theme.MenuHeight - MenuManager.Instance.Theme.LineWidth * 2 / 2); var textPosition = position + new Vector2( MenuManager.Instance.Theme.TextSpacing, MenuManager.Instance.Theme.MenuHeight / 2); Aimtec.Render.Text(textPosition, Color.LightBlue, text, RenderTextFlags.VerticalCenter); }
/// <summary> /// Renders the tooltip /// </summary> public void RenderToolTip() { var text = $"[i] { this.ToolTip}"; int width = Math.Max(this.Parent.Width, (int)MenuManager.Instance.TextWidth(text)); DefaultMenuTheme.DrawRectangleOutline(this.Position.X, this.Position.Y, width, this.Theme.MenuHeight, DefaultMenuTheme.LineWidth, this.Theme.LineColor); var position = this.Position + DefaultMenuTheme.LineWidth; Aimtec.Render.Rectangle( position, width - DefaultMenuTheme.LineWidth, this.Theme.MenuHeight - DefaultMenuTheme.LineWidth, this.Theme.MenuBoxBackgroundColor); var centerPoint = this.Position + new Vector2(width - (DefaultMenuTheme.LineWidth * 2) / 2, this.Theme.MenuHeight - (DefaultMenuTheme.LineWidth * 2) / 2); var textPosition = position + new Vector2(DefaultMenuTheme.TextSpacing, (this.Theme.MenuHeight) / 2); Aimtec.Render.Text( textPosition, Color.LightBlue, text, RenderTextFlags.VerticalCenter); }