Search in sources :

Example 1 with TextRenderStyle

use of org.terasology.engine.rendering.nui.widgets.browser.ui.style.TextRenderStyle in project Terasology by MovingBlocks.

the class TextFlowRenderable method render.

@Override
public void render(Canvas canvas, Rectanglei bounds, TextRenderStyle defaultRenderStyle) {
    TextRenderStyle safeRenderStyle = getTextRenderStyle(defaultRenderStyle);
    Font font = safeRenderStyle.getFont(hyperlink != null);
    int lineHeight = font.getLineHeight();
    Rectanglei bottomBounds = new Rectanglei(bounds.minX, bounds.maxY - lineHeight).setSize(bounds.getSizeX(), lineHeight);
    canvas.drawTextRaw(text, font, safeRenderStyle.getColor(hyperlink != null), bottomBounds);
}
Also used : TextRenderStyle(org.terasology.engine.rendering.nui.widgets.browser.ui.style.TextRenderStyle) FallbackTextRenderStyle(org.terasology.engine.rendering.nui.widgets.browser.ui.style.FallbackTextRenderStyle) Rectanglei(org.terasology.joml.geom.Rectanglei) Font(org.terasology.nui.asset.font.Font)

Aggregations

FallbackTextRenderStyle (org.terasology.engine.rendering.nui.widgets.browser.ui.style.FallbackTextRenderStyle)1 TextRenderStyle (org.terasology.engine.rendering.nui.widgets.browser.ui.style.TextRenderStyle)1 Rectanglei (org.terasology.joml.geom.Rectanglei)1 Font (org.terasology.nui.asset.font.Font)1