示例#1
0
        public void DrawFriends(SpriteBatch spriteBatch, Vector2 position, bool expanded)
        {
            Vector2 iconOffset = position + new Vector2(GameScreenManager.Instance.Dimensions.X - 20, 1);

            if (expanded && friends.Count > 0)
            {
                iconOffset += new Vector2(-friendsRight.framesDimensions.X, 0);
                friendsRight.Draw(spriteBatch, offset + iconOffset + new Vector2(0, (int)((50 / 2) - (friendsRight.framesDimensions.Y / 2)) + 1), 0.82f);
                for (int i = showNum; i < maxFriendsDynamic + showNum; i++)
                {
                    ToggleHoverButton btn = friends[i];
                    btn.Draw(spriteBatch, offset + iconOffset + new Vector2((int)(-btn.getActiveButton().framesDimensions.X), (int)((50 / 2) - (btn.getActiveButton().framesDimensions.Y)) + (int)(btn.getActiveOffset().Y)), 0.82f);
                    iconOffset += new Vector2(-btn.getActiveButton().framesDimensions.X - 3, 0);
                }
                iconOffset += new Vector2(-friendsLeft.framesDimensions.X + 3, 0);
                friendsLeft.Draw(spriteBatch, offset + iconOffset + new Vector2(0, (int)((50 / 2) - (friendsLeft.framesDimensions.Y / 2)) + 1), 0.82f, SpriteEffects.FlipHorizontally);
                iconOffset += new Vector2(-8, 0);
            }
            iconOffset += new Vector2(-32, 0);
            messager.Draw(spriteBatch, offset + iconOffset + new Vector2(0, (int)((50 / 2) - (messager.getActiveButton().framesDimensions.Y / 2)) - 2), 0.82f);
            iconOffset += new Vector2(-messager.getActiveButton().framesDimensions.X - 16, 0);

            searchFriends.Draw(spriteBatch, offset + iconOffset + new Vector2(0, (int)((50 / 2) - (searchFriends.framesDimensions.Y / 2)) - 2), 0.82f);
            iconOffset += new Vector2(-searchFriends.framesDimensions.X - 16, 0);

            myFriends.Draw(spriteBatch, offset + iconOffset + new Vector2(0, (int)((50 / 2) - (myFriends.framesDimensions.Y / 2)) - 2), 0.82f);
            iconOffset += new Vector2(-16, 0);
            if (expanded)
            {
                dividerTwo.Draw(spriteBatch, offset + iconOffset + new Vector2(0, (int)((50 / 2) - (dividerTwo.dimensions.Y / 2))), 0.82f);
            }
        }
示例#2
0
        public void Draw(SpriteBatch spriteBatch, Vector2i pos, float deptLayer = 0.96f)
        {
            Position = pos;
            backdrop.Draw(spriteBatch, pos + new Vector2i(edgeLeft.getActiveButton().framesDimensions.X, edgeTop.getActiveButton().framesDimensions.Y - 2), deptLayer);
            edgeTop.Draw(spriteBatch, pos + new Vector2i(cornerLeft.getActiveButton().framesDimensions.X, 0), deptLayer);
            edgeLeft.Draw(spriteBatch, pos + new Vector2i(0, cornerLeft.getActiveButton().framesDimensions.Y), deptLayer);
            edgeRight.Draw(spriteBatch, pos + new Vector2i(size.X - edgeRight.getActiveButton().framesDimensions.X, cornerLeft.getActiveButton().framesDimensions.Y), deptLayer, SpriteEffects.FlipHorizontally);

            cornerLeft.Draw(spriteBatch, pos + new Vector2i(0, 0), deptLayer + 0.01f);
            cornerRight.Draw(spriteBatch, pos + new Vector2i(size.X - cornerRight.getActiveButton().framesDimensions.X, 0), deptLayer + 0.01f, SpriteEffects.FlipHorizontally);

            buttonName.Draw(spriteBatch, buttonName.GetPosition() + pos + new Vector2i(0, 0), deptLayer + 0.02f);
        }