private void DebugDraw() { var textArea = m_textAreaRelative; textArea.LeftTop += GetPositionAbsoluteTopLeft(); MyGuiManager.DrawBorders(textArea.LeftTop, textArea.Size, Color.White, 1); }
protected void DrawBorder(float transitionAlpha) { if (BorderEnabled || (DEBUG_CONTROL_FOCUS && HasFocus)) { var color = ApplyColorMaskModifiers((DEBUG_CONTROL_FOCUS && HasFocus) ? Vector4.One : (BorderColor * ColorMask), Enabled, transitionAlpha); MyGuiManager.DrawBorders(GetPositionAbsoluteTopLeft(), Size, color, BorderSize); } }
private void DebugDraw() { base.BorderEnabled = true; var topLeft = GetPositionAbsoluteTopLeft(); MyGuiManager.DrawBorders(topLeft + m_selectedItemArea.Position, m_selectedItemArea.Size, Color.Cyan, 1); if (m_isOpen) { MyGuiManager.DrawBorders(topLeft + m_openedArea.Position, m_openedArea.Size, Color.GreenYellow, 1); MyGuiManager.DrawBorders(topLeft + m_openedItemArea.Position, m_openedItemArea.Size, Color.Red, 1); } }
public void Draw(Vector2 mousePosition) { const bool centerHeight = false; var normalizedPosition = mousePosition + MyGuiConstants.TOOL_TIP_RELATIVE_DEFAULT_POSITION; if (Size.X > -1f) { Vector2 innerBorder = new Vector2(0.005f, 0.002f); Vector2 bgSize = Size + 2 * innerBorder; Vector2 bgPosition = normalizedPosition - new Vector2(innerBorder.X, centerHeight ? bgSize.Y / 2 : 0); var screenRectangle = MyGuiManager.FullscreenHudEnabled ? MyGuiManager.GetFullscreenRectangle() : MyGuiManager.GetSafeFullscreenRectangle(); var topleft = MyGuiManager.GetNormalizedCoordinateFromScreenCoordinate(new Vector2(screenRectangle.Left, screenRectangle.Top)) + new Vector2(MyGuiConstants.TOOLTIP_DISTANCE_FROM_BORDER); var rightbottom = MyGuiManager.GetNormalizedCoordinateFromScreenCoordinate(new Vector2(screenRectangle.Right, screenRectangle.Bottom)) - new Vector2(MyGuiConstants.TOOLTIP_DISTANCE_FROM_BORDER); if (bgPosition.X + bgSize.X > rightbottom.X) { bgPosition.X = rightbottom.X - bgSize.X; } if (bgPosition.Y + bgSize.Y > rightbottom.Y) { bgPosition.Y = rightbottom.Y - bgSize.Y; } if (bgPosition.X < topleft.X) { bgPosition.X = topleft.X; } if (bgPosition.Y < topleft.Y) { bgPosition.Y = topleft.Y; } if (Highlight) { Vector2 offset = new Vector2(0.003f, 0.004f); Vector2 highlightPosition = bgPosition - offset; Vector2 highlightSize = bgSize + 2 * offset; MyGuiConstants.TEXTURE_RECTANGLE_NEUTRAL.Draw(highlightPosition, highlightSize, HighlightColor); } MyGuiManager.DrawSpriteBatch(MyGuiConstants.BLANK_TEXTURE, bgPosition, bgSize, MyGuiConstants.THEMED_GUI_BACKGROUND_COLOR, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP); MyGuiManager.DrawBorders(bgPosition, bgSize, MyGuiConstants.THEMED_GUI_LINE_COLOR, 1); Vector2 toolTipPosition = bgPosition + new Vector2(innerBorder.X, bgSize.Y / 2 - Size.Y / 2f); foreach (MyColoredText toolTip in ToolTips) { toolTip.Draw(toolTipPosition, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP, 1f, false); toolTipPosition.Y += toolTip.Size.Y; } } }
public override void Draw(float transitionAlpha, float backgroundTransitionAlpha) { var position = GetPositionAbsoluteTopRight(); var size = new Vector2(m_BSlider.Size.X, m_textLabel.Size.Y); MyGuiManager.DrawSpriteBatch( MyGuiConstants.BLANK_TEXTURE, position, size, ApplyColorMaskModifiers(m_color.ToVector4(), true, transitionAlpha), MyGuiDrawAlignEnum.HORISONTAL_RIGHT_AND_VERTICAL_TOP); base.Draw(transitionAlpha, backgroundTransitionAlpha); position.X -= size.X; MyGuiManager.DrawBorders(position, size, Color.White, BorderSize); }
private void DebugDraw() { var topLeft = GetPositionAbsoluteTopLeft(); MyGuiManager.DrawBorders(topLeft + m_headerArea.Position, m_headerArea.Size, Color.Cyan, 1); MyGuiManager.DrawBorders(topLeft + m_rowsArea.Position, m_rowsArea.Size, Color.White, 1); var position = topLeft + m_headerArea.Position; for (int i = 0; i < m_columnsMetaData.Count; ++i) { var meta = m_columnsMetaData[i]; var cellSize = new Vector2(meta.Width * m_rowsArea.Size.X, m_headerArea.Height); MyGuiManager.DrawBorders(position, cellSize, Color.Yellow, 1); position.X += meta.Width * m_headerArea.Width; } m_scrollBar.DebugDraw(); }
private void DebugDraw() { MyGuiManager.DrawBorders(new Vector2(m_itemsRectangle.X, m_itemsRectangle.Y), new Vector2(m_itemsRectangle.Width, m_itemsRectangle.Height), Color.White, 1); if (IsValidIndex(MouseOverIndex)) { var padding = m_styleDef.ItemPadding; var col = ComputeColumn(MouseOverIndex); var row = ComputeRow(MouseOverIndex); var positionTopLeft = m_itemsRectangle.Position + m_itemStep * new Vector2((float)col, (float)row); positionTopLeft += padding.TopLeftOffset; var size = ItemSize - padding.SizeChange; MyGuiManager.DrawBorders(positionTopLeft, size, Color.White, 1); } }
private void DebugDraw() { MyGuiManager.DrawBorders(GetPositionAbsoluteTopLeft() + m_internalArea.Position, m_internalArea.Size, Color.White, 1); }
public void DebugDraw() { MyGuiManager.DrawBorders(OwnerControl.GetPositionAbsoluteCenter() + Position, Size, Color.White, 1); }
private void DebugDraw() { MyGuiManager.DrawBorders(GetPositionAbsoluteTopLeft(), Size, Color.White, 2); MyGuiManager.DrawBorders(GetPositionAbsoluteTopLeft() + m_scrolledArea.Position, m_scrolledArea.Size, Color.Cyan, 1); }
private void DebugDraw() { MyGuiManager.DrawBorders(GetPositionAbsoluteTopLeft() + m_itemsRectangle.Position, m_itemsRectangle.Size, Color.White, 1); m_scrollBar.DebugDraw(); }