示例#1
0
        public static BitmapTextTuple GetOne(BitmapFontCharacter character, Vector2 localPosition, Color?color = null)
        {
            if (Pool.Count == 0)
            {
                FeedPool(64);
            }

            var lastIndex = Pool.Count - 1;
            var item      = Pool[lastIndex];

            Pool.RemoveAt(lastIndex);

            item.FontCharacter  = character;
            item.LocalPosition  = localPosition;
            item.GlobalPosition = localPosition;
            item.Color          = color ?? Color.White;

            return(item);
        }
 public void AddCharacter(BitmapFontCharacter bitmapFontCharacter)
 {
     _characters.Add(bitmapFontCharacter.CharacterChar, bitmapFontCharacter);
 }