示例#1
0
        public virtual void Update(float fDeltaTime)
        {
            m_fLiveTime += fDeltaTime;
            m_Tooltip = null;
            foreach (Button b in m_Buttons)
            {
                // If the button is enabled, the mouse is pointing to it, and the UI is the top one
                if (b.Enabled && b.m_Bounds.Contains(InputManager.Get().MousePosition) &&
                    GameState.Get().GetCurrentUI() == this)
                {
                    b.HasFocus = true;
                    m_Tooltip = b.m_Tooltip;
                }
                else
                {
                    b.HasFocus = false;
                }
            }

            m_Timer.Update(fDeltaTime);
        }
示例#2
0
        private void MakeTooltip(string TooltipKey, LinkedList<TipData> list)
        {
            if (TooltipKey != "")
            {
                Vector2 vBottomLeft = new Vector2(m_Bounds.X, m_Bounds.Y);
                vBottomLeft.X += m_Bounds.Width;
                if (vBottomLeft.X + GlobalDefines.fToolTipMaxWidth >
                    GraphicsManager.Get().Width)
                {
                    vBottomLeft.X = GraphicsManager.Get().Width - GlobalDefines.fToolTipMaxWidth - 10.0f;
                }

                m_Tooltip = new Tooltip(TooltipKey, vBottomLeft, list);
            }
        }