//TODO: do for other font sizes too! protected int GetFittingFontSize(string text, TextOverlayFonts font, int availableWidth, int availableHeight) { if (font == TextOverlayFonts.RobotoBold) { return((int)((availableWidth * 1.3f) / text.Length)); } else { return((int)((availableWidth * 1.3f) / text.Length)); } }
public OverlayWord(string word) { txt = word; this.durationScale = 1f; this.sizeScale = 1f; this.font = TextOverlayFonts.RobotoThin; this.type = TextOverlayAnimationTypes.NoEffect; this.audio = null; this.silent = false; this.color = new Color(1.0f, 1.0f, 1.0f, TextManager.THIS.currentAlpha); }
public OverlayWord SetFont(TextOverlayFonts font) { this.font = font; return(this); }