static void Main(string[] args) { font state = 0; while (true) { Console.WriteLine($"Параметры надписи: {state}"); Console.WriteLine("Введите:"); Console.WriteLine("\t1: bold"); Console.WriteLine("\t2: italic"); Console.WriteLine("\t3: underline"); int n = Convert.ToInt32(Console.ReadLine()); n = 1 << (n - 1); // convert 1 to 1, 2 to 2, 3 to 4, 4 to 8, 5 to 16 etc state ^= (font)n; } }
public SpriteFont GetFont(string name, bool isBold, int size) { foreach (font f in fontsList) { if (f.name.Equals(name) && f.isBold == isBold && f.size == size) { return(f.sprite); } } font nFont = new font(); nFont.sprite = content.Load <SpriteFont>("Fonts/" + name + "_" + ((isBold) ? "1" : "0") + "_" + size); nFont.name = name; nFont.isBold = isBold; nFont.size = size; fontsList.Add(nFont); return(nFont.sprite); }
? FontUnitsToPt(font, entry.Value <int>())
PB_Map.Image = TerrainSprite.GetMapWithBuildings(Terrain, Buildings, px, py, font, scale, index);
return(new TextAnnotationRenderable(font, pos + vec, zOffset, color, text));
return(new UITextRenderable(font, effectiveWorldPos + vec, screenPos, zOffset, color, text));
public SpriteFont GetFont(string name, bool isBold, int size) { foreach (font f in fontsList) if (f.name.Equals(name) && f.isBold == isBold && f.size == size) return f.sprite; font nFont = new font(); nFont.sprite = content.Load<SpriteFont>("Fonts/" + name + "_" + ((isBold) ? "1" : "0") + "_" + size); nFont.name = name; nFont.isBold = isBold; nFont.size = size; fontsList.Add(nFont); return nFont.sprite; }