Package rosequartz.gfx
Interface Font<F extends Font<F>>
- Type Parameters:
F- type of the class implementing this class
- All Known Implementing Classes:
BitmapFont
public interface Font<F extends Font<F>>
Represents any font.
-
Method Summary
Modifier and TypeMethodDescriptionfloatgetTextHeight(String text, float height, float spacingVertical)Gets the height of a given text.floatgetTextWidth(String text, float height, float spacingHorizontal)Gets the width of a given text.render(String text, float x, float y, float height, float spacingHorizontal, float spacingVertical)Render a given text onto the current target frame buffer using texture coordinates.
-
Method Details
-
getTextWidth
Gets the width of a given text.- Parameters:
text- text to calculate width ofheight- height of the textspacingHorizontal- spacing between characters on the x-axis
-
getTextHeight
Gets the height of a given text.- Parameters:
text- text to calculate width ofheight- height of the textspacingVertical- spacing between characters on the y-axis
-
render
F render(String text, float x, float y, float height, float spacingHorizontal, float spacingVertical) throws NotOnGraphicsThreadExceptionRender a given text onto the current target frame buffer using texture coordinates.- Parameters:
text- text to renderx- position of the bottom left corner of the rendered text on the x-axisy- position of the bottom left corner of the rendered text on the y-axisheight- height of the textspacingHorizontal- space between every character on the x-axisspacingVertical- space between every character on the y-axis- Throws:
NotOnGraphicsThreadException
-