Package org.terasology.rendering.assets.font

Examples of org.terasology.rendering.assets.font.Font


        }
    }

    @Override
    public Vector2i getPreferredContentSize(Canvas canvas, Vector2i areaHint) {
        Font font = canvas.getCurrentStyle().getFont();
        if (isMultiline()) {
            List<String> lines = TextLineBuilder.getLines(font, text.get(), areaHint.x);
            return font.getSize(lines);
        } else {
            return new Vector2i(font.getWidth(getText()), font.getLineHeight());
        }
    }
View Full Code Here


        canvas.addInteractionRegion(interactionListener);
    }

    @Override
    public Vector2i getPreferredContentSize(Canvas canvas, Vector2i areaHint) {
        Font font = canvas.getCurrentStyle().getFont();
        String text = "";
        if (capturingInput) {
            text = "???";
        } else if (input.get() != null) {
            text = input.get().getDisplayName();
        }
        List<String> lines = TextLineBuilder.getLines(font, text, areaHint.getX());
        Vector2i size = font.getSize(lines);
        return size;
    }
View Full Code Here

TOP

Related Classes of org.terasology.rendering.assets.font.Font

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.