public interface ImageRenderer
Image renderers are used to draw custom areas in a manual page, defined as an image with a special URL, matching the prefix of a registered image provider. A renderer will then be used to draw something at the position of the image tag.
Built-in image renderers are item, block and tag.
| 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.
|
int getWidth()
This is used to offset the OpenGL state properly before calling
render(int, int), to correctly align the image horizontally.
int getHeight()
This is used to offset the OpenGL state properly before calling
render(int, int), as well as to know where to resume rendering
other content below the image.
void render(int mouseX,
int mouseY)
This 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.
mouseX - the X position of the mouse relative to the element.mouseY - the Y position of the mouse relative to the element.