public BitmapFont getFont() { return font.getFont(); }
/** * @param font */ public void setFont(com.harium.etyl.core.graphics.Font font) { screen.setFont(font.getFont()); }
/** * * @param font */ public void setFont(com.harium.etyl.core.graphics.Font font) { screen.setFont(font.getFont()); }
public Font getFont(String fontName, float size) { Font font = loadFont(fontName); font.getFont().deriveFont(size); return font; }
@Override public int textWidth(String text) { if (!definedFont) { return 0; } GlyphLayout layout = new GlyphLayout(font.getFont(), text); return (int) layout.width; }
public Font getFont(String fontName, float size) { Font font = loadFont(fontName); font.getFont().deriveFont(size); return font; }
public Font getFont(String fontName, float size) { Font font = loadFont(fontName); font.getFont().deriveFont(size); return font; }
private void drawFont(String text, float x, float y) { font.getFont().draw(batch, text, x, height - y - fontOffsetFix); }
public void setFontColor(Color color) { font.getFont().setColor(color); }
public void setFontName(String fontName) { this.fontName = fontName; this.font = FontLoader.getInstance().loadFont(fontName).getFont().deriveFont(style, size); }
public void setFontName(String fontName) { this.fontName = fontName; this.font = FontLoader.getInstance().loadFont(fontName).getFont().deriveFont(style, size); }
public void setColor(Color color) { setBatchColor(color); if (definedFont) { font.getFont().setColor(color); } }
public void setFont(Font font) { this.font = font; definedFont = true; updateFontFix(); // Set color if it was defined before the font was setted font.getFont().setColor(currentColor); }
public void setFontColor(int color) { font.getFont().setColor(buildColor(color)); }
public void drawString(String text, int x, int y) { beginBatch(); drawFont(text, x, y - font.getFont().getCapHeight()); }
public void drawString(String text, int x, int y, int w, int h) { beginBatch(); GlyphLayout layout = new GlyphLayout(); layout.setText(font.getFont(), text); float cx = w / 2 - layout.width / 2; float cy = h / 2 - layout.height / 2; drawFont(text, x + cx, y + cy); }
public void drawStringX(String text, int y) { beginBatch(); GlyphLayout layout = new GlyphLayout(); layout.setText(font.getFont(), text); float cx = width / 2 - layout.width / 2; drawFont(text, cx, y); }
@Override public void setFontColor(com.harium.etyl.commons.graphics.Color color) { float r = color.getRed() / 255f; float g = color.getGreen() / 255f; float b = color.getBlue() / 255f; float a = color.getAlpha() / 255f; font.getFont().setColor(new Color(r, g, b, a)); }
public void setFontSize(float size) { if (font.getSize() == (int) size) { return; } font.getFont().getData().setScale(size / font.getOriginalSize()); font.setSize((int) size); updateFontFix(); }