Ejemplo n.º 1
0
 private void InternalDraw(IBatchRenderer sbatch, FRectangle bounds, string textBase, string textAlt)
 {
     if (Icon != null)
     {
         var b = Icon.Size().Underfit(bounds.Size, IconPadding);
         sbatch.DrawCentered(Icon, bounds.Center, b.Width, b.Height, HUDKeyboard.COLOR_TEXT);
     }
     else
     {
         if (!string.IsNullOrEmpty(textBase))
         {
             FontRenderHelper.DrawTextCentered(sbatch, HUD.DefaultFont, TextSize, textBase, HUDKeyboard.COLOR_TEXT, bounds.Center);
         }
         if (!string.IsNullOrEmpty(textAlt))
         {
             FontRenderHelper.DrawTextTopRight(sbatch, HUD.DefaultFont, TextSizeAlt, textAlt, HUDKeyboard.COLOR_ALT, bounds.TopRight + new Vector2(-TextAltPadding, 0));
         }
     }
 }