public interface IGraphics
IGraphics object given to you in render methods or access IGameInstance.getGraphics()| Modifier and Type | Method and Description |
|---|---|
void |
backgroundColor(float r,
float g,
float b,
float a)
Sets the background color (the color to fill the screen with at the start
of every render cycle).
|
void |
backgroundColor(int color)
Sets the background color (the color to fill the screen with at the start
of every render cycle).
|
void |
bindColor(float r,
float g,
float b,
float a)
Binds the specifid color to the GL context.
|
void |
bindColor(int color)
Binds the specified color to the GL context.
|
void |
describeItem(IGameInstance game,
IAssetManager manager,
ItemInstance instance)
Renders an item's hover over information on the mouse cursor position.
|
void |
drawHoverInfo(IGameInstance game,
IAssetManager manager,
float x,
float y,
float scale,
boolean firstLineOffset,
boolean canLeaveScreen,
int maxLength,
java.util.List<java.lang.String> text)
Draws a hovering information at the specified position using the
specified text
|
void |
drawHoverInfoAtMouse(IGameInstance game,
IAssetManager manager,
boolean firstLineOffset,
int maxLength,
java.util.List<java.lang.String> text)
Draws a hovering information at the mouse's position using the specified
text
|
void |
drawHoverInfoAtMouse(IGameInstance game,
IAssetManager manager,
boolean firstLineOffset,
int maxLength,
java.lang.String... text)
Draws a hovering information at the mouse's position using the specified
text
|
void |
drawRect(float x,
float y,
float width,
float height,
float lineWidth,
int color)
Draws a colored, unfilled rectangle at the specified x and y
coordinates.
|
void |
drawRect(float x,
float y,
float width,
float height,
int color)
Draws a colored, unfilled rectangle at the specified x and y
coordinates.
|
void |
fillRect(float x,
float y,
float width,
float height,
int color)
Draws a colored, filled rectangle at the spcified x and y coordinates.
|
void |
popMatrix()
Pops the GL matrix.
|
void |
pushMatrix()
Pushes the GL matrix.
|
void |
renderItemInGui(IGameInstance game,
IAssetManager manager,
ItemInstance slot,
float x,
float y,
float scale,
int color)
Renders an item and its amount.
|
void |
renderSlotInGui(IGameInstance game,
IAssetManager manager,
ItemInstance slot,
float x,
float y,
float scale,
boolean hovered)
Renders a slot.
|
void |
rotate(float angle)
Rotates the GL context by the specified angle.
|
void |
scale(float scaleX,
float scaleY)
Scales the GL context by the specified x and y scale.
|
void |
translate(float x,
float y)
Translates the GL context by the specified x and y coordinates.
|
void renderSlotInGui(IGameInstance game, IAssetManager manager, ItemInstance slot, float x, float y, float scale, boolean hovered)
ItemContainer to create functioning slots.game - The game instancemanager - The asset managerslot - The content of the slot to drawx - The x coordinatey - The y coordinatescale - The scalehovered - If the slot is currently being hovered or not (ie if it
should show the hover info of what is in the slot)void renderItemInGui(IGameInstance game, IAssetManager manager, ItemInstance slot, float x, float y, float scale, int color)
renderSlotInGui(IGameInstance, IAssetManager, ItemInstance, float,
float, float, boolean), only that it doesn't render the box below the
item.game - The game instancemanager - The asset managerslot - The item to drawx - The x coordinatey - The y coordinatescale - The scalecolor - The color to filter the item's renderer withvoid describeItem(IGameInstance game, IAssetManager manager, ItemInstance instance)
IGameInstance.isItemInfoDebug() text
and also fires the TooltipEvent.game - The game instancemanager - The asset managerinstance - The item whose information to drawvoid drawHoverInfoAtMouse(IGameInstance game, IAssetManager manager, boolean firstLineOffset, int maxLength, java.lang.String... text)
game - The game instancemanager - The asset managerfirstLineOffset - If the first line should have a bit of a gap below
it making it act as a "headline"maxLength - The maximum length before the tooltip wraps into
the next linetext - The array of lines of text to drawvoid drawHoverInfoAtMouse(IGameInstance game, IAssetManager manager, boolean firstLineOffset, int maxLength, java.util.List<java.lang.String> text)
game - The game instancemanager - The asset managerfirstLineOffset - If the first line should have a bit of a gap below
it making it act as a "headline"maxLength - The maximum length before the tooltip wraps into
the next linetext - The list of lines of text to drawvoid drawHoverInfo(IGameInstance game, IAssetManager manager, float x, float y, float scale, boolean firstLineOffset, boolean canLeaveScreen, int maxLength, java.util.List<java.lang.String> text)
game - The game instancemanager - The asset managerx - The x positiony - The y positionscale - The scale of the tooltipfirstLineOffset - If the first line should have a bit of a gap below
it making it act as a "headline"canLeaveScreen - If the tooltip can leave the screen or should stop
at the bordersmaxLength - The maximum length before the tooltip wraps into
the next linetext - The list of lines of text to drawvoid pushMatrix()
GL11.glPushMatrix() for reference.void popMatrix()
GL11.glPopMatrix() for reference.void bindColor(int color)
GL11.glColor4f(float, float, float, float) for reference. Note that
every hex color used in the game needs to contain an alpha component for
it to display.color - The colorvoid bindColor(float r,
float g,
float b,
float a)
GL11.glColor4f(float, float, float, float) for reference.r - The red component (0-1)g - The green component (0-1)b - The blue component (0-1)a - The alpha (0-1)void backgroundColor(int color)
GL11.glClearColor(float, float, float,
float) for reference. Note that every hex color used in the game needs
to contain an alpha component for it to display.color - The colorvoid backgroundColor(float r,
float g,
float b,
float a)
GL11.glClearColor(float, float, float,
float) for reference.r - The red component (0-1)g - The green component (0-1)b - The blue component (0-1)a - The alpha (0-1)void scale(float scaleX,
float scaleY)
GL11.glScalef(float, float, float) for reference.scaleX - The x scalescaleY - The y scalevoid translate(float x,
float y)
GL11.glPixelTransferf(int, float) for reference.x - The x coordinatey - The y coordinatevoid rotate(float angle)
GL11.glRotatef(float, float, float, float) for reference. Note that this
will only ever rotate around one axis as anything else makes little sense
in a 2d game.angle - The angle in degrees to rotate byvoid drawRect(float x,
float y,
float width,
float height,
int color)
x - The x coordinatey - The y coordinatewidth - The widthheight - The heightcolor - The colorvoid drawRect(float x,
float y,
float width,
float height,
float lineWidth,
int color)
x - The x coordinatey - The y coordinatewidth - The widthheight - The heightlineWidth - The width of the outlinescolor - The colorvoid fillRect(float x,
float y,
float width,
float height,
int color)
x - The x coordinatey - The y coordinatewidth - The widthheight - The heightcolor - The color