BitmapSpriteText GetBitmapSpriteText(BitmapSpriteFont font)
        {
            SpriteList l;
            long key = font.AssetId;


            if (bitmapTexts.ContainsKey(key))
            {
                l = bitmapTexts[key];
            }
            else
            {
                l = new SpriteList(this, SpriteList.SpriteType.BitmapSpriteText);
                l.BitmapSpriteFont = font;
                l.ParentCanvas = Canvas;
                bitmapTexts.Add(key, l);
            }
            BitmapSpriteText s = l.GetSprite() as BitmapSpriteText;
            return s;
        }
 void DrawBitmapStringInternal(BitmapSpriteFont spriteFont, string text, Vector2 position, G.Color color, float rotation, Vector2 origin, Vector2 scale, SpriteEffects effects, float layerDepth)
 {
     BitmapSpriteText d = GetBitmapSpriteText(spriteFont);
     if (d.ZIndex < zIndex)
     {
         d.ZIndex = zIndex;
     }
     else
     {
         zIndex = d.ZIndex;
     }
     zIndex++;
     d.InUse = true;
     d.Text = text;
     d.Color = color;
     d.PositionX = position.X;
     d.PositionY = position.Y;
     d.Scale = new Vector2((float)scale.X, (float)scale.Y);
     d.Rotation = rotation;
     d.Origin = origin;
     d.Effects = effects;
 }
 void DrawBitmapStringInternal(BitmapSpriteFont spriteFont, string text, Vector2 position, G.Color color, float rotation, Vector2 origin, float scale, SpriteEffects effects, float layerDepth)
 {
     DrawBitmapStringInternal(spriteFont, text, position, color, rotation, origin, new Vector2(scale, scale), effects, layerDepth);
 }
示例#4
0
 public void Dispose()
 {
     renderedText = null;
     Texture2D = null;
     Font = null;
     Element = null;
 }