public class GuiRenderer extends MalisisRenderer
MalisisGui.| Modifier and Type | Field and Description |
|---|---|
UIComponent |
currentComponent
Current component being drawn.
|
static int |
FONT_HEIGHT
Font height.
|
static net.minecraft.client.renderer.entity.RenderItem |
itemRenderer
RenderItem used to draw itemStacks.
|
int |
mouseX
Current X position of the mouse.
|
int |
mouseY
Current Y position of the mouse.
|
baseBrightness, block, blockMetadata, damagedIcons, destroyBlockProgress, drawMode, face, getBlockDamage, isShifted, itemRenderType, itemStack, overrideTexture, params, partialTick, renderBlocks, renderGlobal, renderId, renderType, rp, shape, t, tileEntity, vertexDrawn, world, x, y, z| Constructor and Description |
|---|
GuiRenderer()
Instantiates a new
GuiRenderer. |
| Modifier and Type | Method and Description |
|---|---|
void |
applyTexture(Shape shape,
RenderParameters parameters)
Applies the texture the
Shape. |
void |
bindDefaultTexture()
Reset the texture to its
defaultGuiTexture. |
void |
bindTexture(GuiTexture texture)
Bind a new texture for rendering.
|
void |
clean()
Cleans the current renderer state.
|
java.lang.String |
clipString(java.lang.String text,
int width)
Clips a string to fit in the specified width.
|
void |
drawItemStack(net.minecraft.item.ItemStack itemStack,
int x,
int y)
Draws an itemStack to the GUI.
|
void |
drawItemStack(net.minecraft.item.ItemStack itemStack,
int x,
int y,
net.minecraft.util.EnumChatFormatting format)
Draws itemStack to the GUI.
|
void |
drawScreen(UIContainer container,
int mouseX,
int mouseY,
float partialTick)
Draws the component to the screen.
|
void |
drawShape(GuiShape s,
RenderParameters params)
Draws a
Shape to the GUI with the specified RenderParameters. |
void |
drawString(java.lang.String text,
int x,
int y,
int z,
int color,
boolean shadow)
Draws a string at the specified coordinates, with color and shadow.
|
void |
drawText(java.lang.String text)
Draws a white text on the GUI without shadow.
|
void |
drawText(java.lang.String text,
int color,
boolean shadow)
Draws a text on the GUI with specified color and shadow.
|
void |
drawText(java.lang.String text,
int x,
int y,
int color,
boolean shadow)
Draws a text on the GUI at the specified coordinates, relative to its parent container, with color and shadow.
|
void |
drawText(java.lang.String text,
int x,
int y,
int zIndex,
int color,
boolean shadow)
Draws a text on the GUI at the specified coordinates, relative to its parent container, with zIndex, color and shadow.
|
void |
drawTooltip(UITooltip tooltip)
Draws a
UITooltip to the screen. |
void |
endClipping(ClipArea area)
Ends the clipping.
|
static int |
getCharWidth(char c)
Gets the rendering width of a char.
|
static int |
getCharWidth(char c,
float fontScale)
Gets the rendering width of a char with the specified fontScale.
|
GuiTexture |
getDefaultTexture()
Gets the default
GuiTexture. |
static int |
getMaxStringWidth(java.util.List<java.lang.String> strings)
Gets the max string width.
|
static int |
getMaxStringWidth(java.util.List<java.lang.String> strings,
float fontScale)
Gets max rendering width of an array of string.
|
static int |
getStringHeight()
Gets the rendering height of strings.
|
static int |
getStringHeight(float fontScale)
Gets the rendering height of strings according to fontscale.
|
static int |
getStringWidth(java.lang.String str)
Gets rendering width of a string.
|
static int |
getStringWidth(java.lang.String str,
float fontScale)
Gets rendering width of a string according to fontScale.
|
boolean |
isIgnoreScale()
Checks if Minecraft GUI scale is ignored
|
void |
next()
Next.
|
void |
prepare(RenderType renderType,
double... data)
Prepares the
Tessellator and the GL states for the renderType. |
void |
renderPickedItemStack(net.minecraft.item.ItemStack itemStack)
Render the picked up itemStack at the cursor position.
|
void |
set(int mouseX,
int mouseY,
float partialTicks)
Sets the mouse position and the partial tick.
|
void |
setDefaultTexture(GuiTexture texture) |
void |
setFontScale(float scale)
Sets a custom font scale factor.
|
void |
setIgnoreScale(boolean ignore)
Sets whether to ignore default Minecraft GUI scale factor.
|
void |
startClipping(ClipArea area)
Starts clipping an area to prevent drawing outside of it.
|
int |
updateGuiScale()
Sets the width, height and scale factor for this
GuiRenderer. |
static java.util.List<java.lang.String> |
wrapText(java.lang.String text,
int maxWidth)
Splits the string in multiple lines to fit in the specified maxWidth.
|
static java.util.List<java.lang.String> |
wrapText(java.lang.String text,
int maxWidth,
float fontScale)
Splits the string in multiple lines to fit in the specified maxWidth using the specified fontScale.
|
_initialize, applyTexture, bindTexture, calcVertexBrightness, calcVertexColor, calcVertexesPosition, disableTextures, draw, drawFace, drawFace, drawShape, drawShape, drawString, drawVertex, drawVertexes, enableBlending, enableTextures, getAoBrightness, getBaseBrightness, getBlockAmbientOcclusion, getBlockDestroyProgress, getDamagedBlocks, getFontRenderer, getIcon, getMixedBrightnessForBlock, getPartialTick, getRenderBounds, getRenderId, handleRenderType, initialize, isCurrentBlockDestroyProgress, next, registerFor, registerFor, registerForRenderWorldLast, render, renderDestroyProgress, renderInventoryBlock, renderItem, renderStandard, renderStandard, renderTileEntityAt, renderWorldBlock, renderWorldLastEvent, reset, set, set, set, set, set, set, set, set, shouldRender, shouldRender3DInInventory, shouldRenderFace, shouldSetViewportPosition, shouldUseRenderHelper, startDrawing, startDrawing, tessellatorShift, tessellatorUnshiftpublic static net.minecraft.client.renderer.entity.RenderItem itemRenderer
public static int FONT_HEIGHT
public UIComponent currentComponent
public int mouseX
public int mouseY
public GuiRenderer()
GuiRenderer.public GuiTexture getDefaultTexture()
GuiTexture.public void setDefaultTexture(GuiTexture texture)
public void setIgnoreScale(boolean ignore)
ignore - the new ignore scalepublic boolean isIgnoreScale()
public void setFontScale(float scale)
scale - the new font scalepublic int updateGuiScale()
GuiRenderer.public void set(int mouseX,
int mouseY,
float partialTicks)
mouseX - the mouse xmouseY - the mouse ypartialTicks - the partial tickspublic void prepare(RenderType renderType, double... data)
MalisisRendererTessellator and the GL states for the renderType. data is only used for TESR and IRWL.prepare in class MalisisRendererrenderType - the render typedata - the datapublic void clean()
MalisisRendererclean in class MalisisRendererpublic void drawScreen(UIContainer container, int mouseX, int mouseY, float partialTick)
container - the containermouseX - the mouse xmouseY - the mouse ypartialTick - the partial tickpublic void drawTooltip(UITooltip tooltip)
UITooltip to the screen.tooltip - the tooltippublic void drawShape(GuiShape s, RenderParameters params)
Shape to the GUI with the specified RenderParameters.s - the sparams - the paramspublic void applyTexture(Shape shape, RenderParameters parameters)
Shape.applyTexture in class MalisisRenderershape - the shapeparameters - the parameterspublic java.lang.String clipString(java.lang.String text,
int width)
text - the textwidth - the widthpublic static java.util.List<java.lang.String> wrapText(java.lang.String text,
int maxWidth)
text - the textmaxWidth - the max widthpublic static java.util.List<java.lang.String> wrapText(java.lang.String text,
int maxWidth,
float fontScale)
text - the textmaxWidth - the max widthfontScale - the font scalepublic void drawText(java.lang.String text)
text - the textpublic void drawText(java.lang.String text,
int color,
boolean shadow)
text - the textcolor - the colorshadow - the shadowpublic void drawText(java.lang.String text,
int x,
int y,
int color,
boolean shadow)
text - the textx - the xy - the ycolor - the colorshadow - the shadowpublic void drawText(java.lang.String text,
int x,
int y,
int zIndex,
int color,
boolean shadow)
text - the textx - the xy - the yzIndex - the z indexcolor - the colorshadow - the shadowpublic void drawString(java.lang.String text,
int x,
int y,
int z,
int color,
boolean shadow)
text - the textx - the xy - the yz - the zcolor - the colorshadow - the shadowpublic void drawItemStack(net.minecraft.item.ItemStack itemStack,
int x,
int y)
itemStack - the item stackx - the xy - the ypublic void drawItemStack(net.minecraft.item.ItemStack itemStack,
int x,
int y,
net.minecraft.util.EnumChatFormatting format)
itemStack - the item stackx - the xy - the yformat - the formatpublic void startClipping(ClipArea area)
area - the areapublic void endClipping(ClipArea area)
area - the areapublic void renderPickedItemStack(net.minecraft.item.ItemStack itemStack)
itemStack - the item stackpublic static int getStringWidth(java.lang.String str)
str - the strpublic static int getStringWidth(java.lang.String str,
float fontScale)
str - the strfontScale - the font scalepublic static int getStringHeight()
public static int getStringHeight(float fontScale)
fontScale - the font scalepublic static int getMaxStringWidth(java.util.List<java.lang.String> strings)
strings - the stringspublic static int getMaxStringWidth(java.util.List<java.lang.String> strings,
float fontScale)
strings - the stringsfontScale - the font scalepublic static int getCharWidth(char c)
c - the cpublic static int getCharWidth(char c,
float fontScale)
c - the cfontScale - the font scalepublic void bindTexture(GuiTexture texture)
texture - the texturepublic void bindDefaultTexture()
defaultGuiTexture.public void next()
next in class MalisisRenderer