public class TextureImageRenderer extends java.lang.Object implements ImageRenderer
| Constructor and Description |
|---|
TextureImageRenderer(net.minecraft.util.ResourceLocation location) |
| Modifier and Type | Method and Description |
|---|---|
int |
getHeight()
The height of the area this renderer uses.
|
int |
getWidth()
The width of the area this renderer uses.
|
void |
render(int mouseX,
int mouseY)
Render the image, with specified maximum width.
|
public TextureImageRenderer(net.minecraft.util.ResourceLocation location)
public int getWidth()
ImageRenderer
This is used to offset the OpenGL state properly before calling
ImageRenderer.render(int, int), to correctly align the image horizontally.
getWidth in interface ImageRendererpublic int getHeight()
ImageRenderer
This is used to offset the OpenGL state properly before calling
ImageRenderer.render(int, int), as well as to know where to resume rendering
other content below the image.
getHeight in interface ImageRendererpublic void render(int mouseX,
int mouseY)
ImageRendererThis should render the image as is, the OpenGL state will be set up such that you can start drawing at (0,0,*), and render up to (getWidth,getHeight,*), i.e. translation and scaling are taken care of for you.
render in interface ImageRenderermouseX - the X position of the mouse relative to the element.mouseY - the Y position of the mouse relative to the element.