コード例 #1
0
        public override void Draw(GameTime gameTime)
        {
            if (!Visible)
            {
                base.Draw(gameTime);
                return;
            }

            if (m_members != null)
            {
                SpriteBatch.Begin();
                for (int i = m_scrollBar.ScrollOffset; i < m_scrollBar.LinesToRender + m_scrollBar.ScrollOffset && i < m_members.Count; ++i)
                {
                    PartyMember member = m_members[i];
                    int         yCoord = DRAW_OFFSET_Y + DrawAreaWithOffset.Y + (i - m_scrollBar.ScrollOffset) * 13;
                    m_buttons[i].DrawLocation = new Vector2(DRAW_REMOVE_X, yCoord - DrawAreaWithOffset.Y + 1);
                    SpriteBatch.Draw(OldChatTab.GetChatIcon(member.IsLeader ? ChatIcon.Star : ChatIcon.Player), new Vector2(DrawAreaWithOffset.X + DRAW_ICON_X, yCoord), Color.White);
                    SpriteBatch.DrawString(((EOGame)Game).DBGFont, member.Name, new Vector2(DrawAreaWithOffset.X + DRAW_NAME_X, yCoord), Color.Black);
                    SpriteBatch.DrawString(((EOGame)Game).DBGFont, "" + member.Level, new Vector2(DrawAreaWithOffset.X + DRAW_LEVEL_X, yCoord), Color.Black);
                    SpriteBatch.DrawString(((EOGame)Game).DBGFont, "HP", new Vector2(DrawAreaWithOffset.X + DRAW_HP_X, yCoord), Color.Black);
                    _drawHealthBar(member.PercentHealth, yCoord);
                }
                SpriteBatch.End();
            }

            base.Draw(gameTime);
        }
コード例 #2
0
 public OldChatRenderer()
 {
     tabs = new OldChatTab[Enum.GetNames(typeof(ChatTab)).Length - 1]; // -1 skips the 'none' tab which is used for news
     for (int i = 0; i < tabs.Length; ++i)
     {
         tabs[i] = new OldChatTab((ChatTab)i, this, (ChatTab)i == ChatTab.Local)
         {
             DrawLocation = i > (int)ChatTab.Private2
                 ? new Vector2(289 + 44 * (i - 2), 102)
                 : new Vector2((ChatTab)i == ChatTab.Private1 ? 23 : 156, 102)
         };
     }
 }