public class BuildCraftGui
extends java.lang.Object
GuiScreen
class.
This isn't final, although you should generally only subclass this for additional library functionality, not to render out a particular gui.
Classes extending GuiScreen
(either directly or indirectly) need to call the following methods:
tick()
once per tick (usually in GuiScreen.updateScreen()
drawBackgroundLayer(float, int, int, Runnable)
before drawing anything else, except for your own
backgroundsdrawElementBackgrounds()
after drawBackgroundLayer(float, int, int, Runnable)
,but before
sub-display backgroundsdrawElementForegrounds(Runnable)
after drawing everything else.preDrawForeground()
if your base gui class offsets the call to drawing the foreground by the gui's
position, for example, GuiContainer
.postDrawForeground()
after preDrawForeground()
(and the same rules apply). These two calls
should wrap around and calls to this that occur while the gl state is translated.
onMouseClicked(int, int, int)
whenever the mouse is clicked. If this returns true you shouldn't do any
other mouse click handling.onMouseReleased(int, int, int)
whenever the mouse is released.onMouseDragged(int, int, int, long)
whenever the mouse is dragged.drawBackgroundLayer(float, int, int, Runnable)
and drawElementForegrounds(Runnable)
the
Runnable
passed will only be called once, and it's call time will differ based on the
currentMenu
.Modifier and Type | Field and Description |
---|---|
IMenuElement |
currentMenu |
net.minecraft.client.gui.GuiScreen |
gui |
static IVariableNode.IVariableNodeBoolean |
isDebuggingEnabled
Used to control if this gui should show debugging lines, and other oddities that help development.
|
static IVariableNode.IVariableNodeBoolean |
isDebuggingShown
If true then the debug icon will be shown.
|
IGuiPosition |
lowerLeftLedgerPos
Ledger-style elements.
|
IGuiPosition |
lowerRightLedgerPos
Ledger-style elements.
|
net.minecraft.client.Minecraft |
mc |
MousePosition |
mouse |
IGuiArea |
rootElement
The area that most of the GUI elements should be in.
|
IGuiArea |
screenElement
The area that encompasses the entire screen.
|
java.util.List<IGuiElement> |
shownElements
All of the
IGuiElement which will be drawn by this gui. |
static GuiSpriteScaled |
SPRITE_DEBUG |
Constructor and Description |
---|
BuildCraftGui(net.minecraft.client.gui.GuiScreen gui)
Creates a new
BuildCraftGui that uses the entire screen for display. |
BuildCraftGui(net.minecraft.client.gui.GuiScreen gui,
IGuiArea rootElement) |
Modifier and Type | Method and Description |
---|---|
static IGuiArea |
createWindowedArea(net.minecraft.client.gui.inventory.GuiContainer gui)
|
void |
drawBackgroundLayer(float partialTicks,
int mouseX,
int mouseY,
java.lang.Runnable menuBackgroundRenderer) |
void |
drawElementBackgrounds() |
void |
drawElementForegrounds(java.lang.Runnable menuBackgroundRenderer) |
java.util.List<IGuiElement> |
getElementsAt(double x,
double y) |
float |
getLastPartialTicks() |
boolean |
onKeyTyped(char typedChar,
int keyCode) |
boolean |
onMouseClicked(int mouseX,
int mouseY,
int mouseButton) |
void |
onMouseDragged(int mouseX,
int mouseY,
int clickedMouseButton,
long timeSinceLastClick) |
void |
onMouseReleased(int mouseX,
int mouseY,
int state) |
void |
postDrawForeground() |
void |
preDrawForeground() |
void |
tick() |
public static final IVariableNode.IVariableNodeBoolean isDebuggingEnabled
public static final IVariableNode.IVariableNodeBoolean isDebuggingShown
public static final GuiSpriteScaled SPRITE_DEBUG
public final net.minecraft.client.Minecraft mc
public final net.minecraft.client.gui.GuiScreen gui
public final MousePosition mouse
public final IGuiArea screenElement
public final IGuiArea rootElement
screenElement
.public final java.util.List<IGuiElement> shownElements
IGuiElement
which will be drawn by this gui.public IMenuElement currentMenu
public IGuiPosition lowerLeftLedgerPos
public IGuiPosition lowerRightLedgerPos
public BuildCraftGui(net.minecraft.client.gui.GuiScreen gui, IGuiArea rootElement)
public BuildCraftGui(net.minecraft.client.gui.GuiScreen gui)
BuildCraftGui
that uses the entire screen for display. Ledgers are displayed on the
opposite side (so that they expand properly).gui
- public static IGuiArea createWindowedArea(net.minecraft.client.gui.inventory.GuiContainer gui)
public final float getLastPartialTicks()
public void tick()
public java.util.List<IGuiElement> getElementsAt(double x, double y)
public void drawBackgroundLayer(float partialTicks, int mouseX, int mouseY, java.lang.Runnable menuBackgroundRenderer)
public void drawElementBackgrounds()
public void preDrawForeground()
public void postDrawForeground()
public void drawElementForegrounds(java.lang.Runnable menuBackgroundRenderer)
menuBackgroundRenderer
- Will be called to draw the background if the current menu returns true from
IMenuElement.shouldFullyOverride()
. This will draw above all of the normal elements.
GL11.GL_DEPTH_TEST
will have been disabled for this.public boolean onMouseClicked(int mouseX, int mouseY, int mouseButton)
currentMenu
fully overrides
other mouse
clicks, false otherwise.public void onMouseDragged(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick)
public void onMouseReleased(int mouseX, int mouseY, int state)
public boolean onKeyTyped(char typedChar, int keyCode)