public class FontRenderer extends java.lang.Object implements IResourceManagerReloadListener
| Modifier and Type | Field and Description |
|---|---|
protected int[] |
charWidth
Array of width of all the characters in default.png
|
int |
FONT_HEIGHT
the height in pixels of default text
|
java.util.Random |
fontRandom |
protected byte[] |
glyphWidth
Array of the start/end column (in upper/lower nibble) for every glyph in the /font directory.
|
protected ResourceLocation |
locationFontTexture |
protected float |
posX
Current X coordinate at which to draw the next character.
|
protected float |
posY
Current Y coordinate at which to draw the next character.
|
| Constructor and Description |
|---|
FontRenderer(GameSettings p_i1035_1_,
ResourceLocation p_i1035_2_,
TextureManager p_i1035_3_,
boolean p_i1035_4_) |
| Modifier and Type | Method and Description |
|---|---|
protected void |
bindTexture(ResourceLocation location) |
protected void |
doDraw(float f) |
void |
drawSplitString(java.lang.String p_78279_1_,
int p_78279_2_,
int p_78279_3_,
int p_78279_4_,
int p_78279_5_)
Splits and draws a String with wordwrap (maximum length is parameter k)
|
int |
drawString(java.lang.String p_78276_1_,
int p_78276_2_,
int p_78276_3_,
int p_78276_4_)
Draws the specified string.
|
int |
drawString(java.lang.String p_85187_1_,
int p_85187_2_,
int p_85187_3_,
int p_85187_4_,
boolean p_85187_5_)
Draws the specified string.
|
int |
drawStringWithShadow(java.lang.String p_78261_1_,
int p_78261_2_,
int p_78261_3_,
int p_78261_4_)
Draws the specified string with a shadow.
|
protected void |
enableAlpha() |
boolean |
getBidiFlag()
Get bidiFlag that controls if the Unicode Bidirectional Algorithm should be run before rendering any string
|
int |
getCharWidth(char p_78263_1_)
Returns the width of this character as rendered.
|
protected java.io.InputStream |
getResourceInputStream(ResourceLocation location) |
int |
getStringWidth(java.lang.String p_78256_1_)
Returns the width of this string.
|
boolean |
getUnicodeFlag()
Get unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png
font.
|
java.util.List |
listFormattedStringToWidth(java.lang.String p_78271_1_,
int p_78271_2_)
Breaks a string into a list of pieces that will fit a specified width.
|
void |
onResourceManagerReload(IResourceManager p_110549_1_) |
protected float |
renderDefaultChar(int p_78266_1_,
boolean p_78266_2_)
Render a single character with the default.png font at current (posX,posY) location...
|
protected float |
renderUnicodeChar(char p_78277_1_,
boolean p_78277_2_)
Render a single Unicode character at current (posX,posY) location using one of the /font/glyph_XX.png files...
|
void |
setBidiFlag(boolean p_78275_1_)
Set bidiFlag to control if the Unicode Bidirectional Algorithm should be run before rendering any string.
|
protected void |
setColor(float r,
float g,
float b,
float a) |
void |
setUnicodeFlag(boolean p_78264_1_)
Set unicodeFlag controlling whether strings should be rendered with Unicode fonts instead of the default.png
font.
|
int |
splitStringWidth(java.lang.String p_78267_1_,
int p_78267_2_)
Returns the width of the wordwrapped String (maximum length is parameter k)
|
java.lang.String |
trimStringToWidth(java.lang.String p_78269_1_,
int p_78269_2_)
Trims a string to fit a specified Width.
|
java.lang.String |
trimStringToWidth(java.lang.String p_78262_1_,
int p_78262_2_,
boolean p_78262_3_)
Trims a string to a specified width, and will reverse it if par3 is set.
|
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 p_i1035_1_, ResourceLocation p_i1035_2_, TextureManager p_i1035_3_, boolean p_i1035_4_)
public void onResourceManagerReload(IResourceManager p_110549_1_)
onResourceManagerReload in interface IResourceManagerReloadListenerprotected float renderDefaultChar(int p_78266_1_,
boolean p_78266_2_)
protected float renderUnicodeChar(char p_78277_1_,
boolean p_78277_2_)
public int drawStringWithShadow(java.lang.String p_78261_1_,
int p_78261_2_,
int p_78261_3_,
int p_78261_4_)
public int drawString(java.lang.String p_78276_1_,
int p_78276_2_,
int p_78276_3_,
int p_78276_4_)
public int drawString(java.lang.String p_85187_1_,
int p_85187_2_,
int p_85187_3_,
int p_85187_4_,
boolean p_85187_5_)
protected void doDraw(float f)
public int getStringWidth(java.lang.String p_78256_1_)
public int getCharWidth(char p_78263_1_)
public java.lang.String trimStringToWidth(java.lang.String p_78269_1_,
int p_78269_2_)
public java.lang.String trimStringToWidth(java.lang.String p_78262_1_,
int p_78262_2_,
boolean p_78262_3_)
public void drawSplitString(java.lang.String p_78279_1_,
int p_78279_2_,
int p_78279_3_,
int p_78279_4_,
int p_78279_5_)
public int splitStringWidth(java.lang.String p_78267_1_,
int p_78267_2_)
public void setUnicodeFlag(boolean p_78264_1_)
public boolean getUnicodeFlag()
public void setBidiFlag(boolean p_78275_1_)
public java.util.List listFormattedStringToWidth(java.lang.String p_78271_1_,
int p_78271_2_)
public boolean getBidiFlag()
protected void setColor(float r,
float g,
float b,
float a)
protected void enableAlpha()
protected void bindTexture(ResourceLocation location)
protected java.io.InputStream getResourceInputStream(ResourceLocation location) throws java.io.IOException
java.io.IOException