コード例 #1
0
        public void DrawDraged(Vector2 position, float transitionAlpha)
        {
            if ((m_icon != null) || Text != null)
            {
                if (m_icon != null)
                {
                    string texture = m_icon;
                    if (texture == null)
                    { // texture is still being loaded on other thread
                        DrawLoadingIcon(Vector4.One, GetIconPosition(), transitionAlpha);
                    }
                    else
                    {
                        MyGUIHelper.OutsideBorder(position + GetIconPosition(), m_iconSize, 2, MyGuiConstants.THEMED_GUI_LINE_COLOR);
                        MyGuiManager.DrawSpriteBatch(m_icon,
                                                     position + GetIconPosition(), m_iconSize,
                                                     Color.White, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
                    }
                }
                else if (Text != null)
                {
                    var leftTop = position + GetTextPosition();
                    var size    = MyGuiManager.MeasureString(MyFontEnum.Blue, Text, 0.8f);
                    MyGUIHelper.OutsideBorder(leftTop, size, 2, MyGuiConstants.THEMED_GUI_LINE_COLOR);
                    MyGUIHelper.FillRectangle(leftTop, size, TreeView.GetColor(MyGuiConstants.TREEVIEW_SELECTED_ITEM_COLOR, transitionAlpha));

                    Color textColor = TreeView.GetColor(MyGuiConstants.CONTROL_MOUSE_OVER_BACKGROUND_COLOR_MULTIPLIER, transitionAlpha);
                    MyGuiManager.DrawString(MyFontEnum.Blue, Text,
                                            position + GetTextPosition(),
                                            0.8f, textColor, MyGuiDrawAlignEnum.HORISONTAL_LEFT_AND_VERTICAL_TOP);
                }
            }
        }
コード例 #2
0
        public void Draw(float transitionAlpha)
        {
            var scissor = new RectangleF(m_body.GetPosition(), m_body.GetSize());

            using (MyGuiManager.UsingScissorRectangle(ref scissor))
            {
                m_body.Draw(transitionAlpha);
            }

            Color borderColor = MyGuiControlBase.ApplyColorMaskModifiers(MyGuiConstants.TREEVIEW_VERTICAL_LINE_COLOR, true, transitionAlpha);

            MyGUIHelper.OutsideBorder(m_position, m_size, 2, borderColor);

            m_vScrollbar.Draw(Color.White);
            m_hScrollbar.Draw(Color.White);
        }