public class FontRenderer extends java.lang.Object implements IResourceManagerReloadListener
Modifier and Type | Field and Description |
---|---|
protected int[] |
charWidth |
int |
FONT_HEIGHT |
java.util.Random |
fontRandom |
protected byte[] |
glyphWidth |
protected ResourceLocation |
locationFontTexture |
protected float |
posX |
protected float |
posY |
Constructor and Description |
---|
FontRenderer(GameSettings gameSettingsIn,
ResourceLocation location,
TextureManager textureManagerIn,
boolean unicode) |
Modifier and Type | Method and Description |
---|---|
protected void |
bindTexture(ResourceLocation location) |
protected void |
doDraw(float f) |
void |
drawSplitString(java.lang.String str,
int x,
int y,
int wrapWidth,
int textColor) |
int |
drawString(java.lang.String text,
float x,
float y,
int color,
boolean dropShadow) |
int |
drawString(java.lang.String text,
int x,
int y,
int color) |
int |
drawStringWithShadow(java.lang.String text,
float x,
float y,
int color) |
protected void |
enableAlpha() |
boolean |
getBidiFlag() |
int |
getCharWidth(char character) |
int |
getColorCode(char character) |
static java.lang.String |
getFormatFromString(java.lang.String text) |
protected IResource |
getResource(ResourceLocation location) |
int |
getStringWidth(java.lang.String text) |
boolean |
getUnicodeFlag() |
java.util.List<java.lang.String> |
listFormattedStringToWidth(java.lang.String str,
int wrapWidth) |
void |
onResourceManagerReload(IResourceManager resourceManager) |
protected float |
renderDefaultChar(int ch,
boolean italic) |
protected float |
renderUnicodeChar(char ch,
boolean italic) |
void |
setBidiFlag(boolean bidiFlagIn) |
protected void |
setColor(float r,
float g,
float b,
float a) |
void |
setUnicodeFlag(boolean unicodeFlagIn) |
int |
splitStringWidth(java.lang.String str,
int maxLength) |
java.lang.String |
trimStringToWidth(java.lang.String text,
int width) |
java.lang.String |
trimStringToWidth(java.lang.String text,
int width,
boolean reverse) |
protected int[] charWidth
public int FONT_HEIGHT
public java.util.Random fontRandom
protected byte[] glyphWidth
protected final ResourceLocation locationFontTexture
protected float posX
protected float posY
public FontRenderer(GameSettings gameSettingsIn, ResourceLocation location, TextureManager textureManagerIn, boolean unicode)
public void onResourceManagerReload(IResourceManager resourceManager)
onResourceManagerReload
in interface IResourceManagerReloadListener
protected float renderDefaultChar(int ch, boolean italic)
protected float renderUnicodeChar(char ch, boolean italic)
public int drawStringWithShadow(java.lang.String text, float x, float y, int color)
public int drawString(java.lang.String text, int x, int y, int color)
public int drawString(java.lang.String text, float x, float y, int color, boolean dropShadow)
protected void doDraw(float f)
public int getStringWidth(java.lang.String text)
public int getCharWidth(char character)
public java.lang.String trimStringToWidth(java.lang.String text, int width)
public java.lang.String trimStringToWidth(java.lang.String text, int width, boolean reverse)
public void drawSplitString(java.lang.String str, int x, int y, int wrapWidth, int textColor)
public int splitStringWidth(java.lang.String str, int maxLength)
public void setUnicodeFlag(boolean unicodeFlagIn)
public boolean getUnicodeFlag()
public void setBidiFlag(boolean bidiFlagIn)
public java.util.List<java.lang.String> listFormattedStringToWidth(java.lang.String str, int wrapWidth)
public static java.lang.String getFormatFromString(java.lang.String text)
public boolean getBidiFlag()
protected void setColor(float r, float g, float b, float a)
protected void enableAlpha()
protected void bindTexture(ResourceLocation location)
protected IResource getResource(ResourceLocation location) throws java.io.IOException
java.io.IOException
public int getColorCode(char character)