public abstract class GuiScreen extends Gui implements GuiYesNoCallback
Modifier and Type | Field and Description |
---|---|
boolean |
allowUserInput |
protected java.util.List<GuiButton> |
buttonList
A list of all the buttons in this container.
|
protected FontRenderer |
fontRenderer
The FontRenderer used by GuiScreen
|
int |
height
The height of the screen object.
|
protected RenderItem |
itemRender
Holds a instance of RenderItem, used to draw the achievement icons on screen (is based on ItemStack)
|
protected boolean |
keyHandled |
protected java.util.List<GuiLabel> |
labelList
A list of all the labels in this container.
|
Minecraft |
mc
Reference to the Minecraft object.
|
protected boolean |
mouseHandled |
protected GuiButton |
selectedButton
The button that was just pressed.
|
int |
width
The width of the screen object.
|
ICONS, OPTIONS_BACKGROUND, STAT_ICONS, zLevel
Constructor and Description |
---|
GuiScreen() |
Modifier and Type | Method and Description |
---|---|
protected void |
actionPerformed(GuiButton button)
Called by the controls from the buttonList when activated.
|
protected <T extends GuiButton> |
addButton(T buttonIn)
Adds a control to this GUI's button list.
|
void |
confirmClicked(boolean result,
int id) |
boolean |
doesGuiPauseGame()
Returns true if this GUI should pause the game when it is displayed in single-player
|
void |
drawBackground(int tint)
Draws the background (i is always 0 as of 1.2.2)
|
void |
drawDefaultBackground()
Draws either a gradient over the background screen (when it exists) or a flat gradient over background.png
|
void |
drawHoveringText(java.util.List<java.lang.String> textLines,
int x,
int y)
Draws a List of strings as a tooltip.
|
protected void |
drawHoveringText(java.util.List<java.lang.String> textLines,
int x,
int y,
FontRenderer font) |
void |
drawHoveringText(java.lang.String text,
int x,
int y)
Draws the given text as a tooltip.
|
void |
drawScreen(int mouseX,
int mouseY,
float partialTicks)
Draws the screen and all the components in it.
|
void |
drawWorldBackground(int tint) |
static java.lang.String |
getClipboardString()
Returns a string stored in the system clipboard.
|
java.util.List<java.lang.String> |
getItemToolTip(ItemStack p_191927_1_) |
boolean |
handleComponentClick(ITextComponent component)
Executes the click event specified by the given chat component
|
protected void |
handleComponentHover(ITextComponent component,
int x,
int y)
Draws the hover event specified by the given chat component
|
void |
handleInput()
Delegates mouse and keyboard input.
|
void |
handleKeyboardInput()
Handles keyboard input.
|
void |
handleMouseInput()
Handles mouse input.
|
void |
initGui()
Adds the buttons (and other controls) to the screen in question.
|
static boolean |
isAltKeyDown()
Returns true if either alt key is down
|
static boolean |
isCtrlKeyDown()
Returns true if either windows ctrl key is down or if either mac meta key is down
|
boolean |
isFocused() |
static boolean |
isKeyComboCtrlA(int keyID) |
static boolean |
isKeyComboCtrlC(int keyID) |
static boolean |
isKeyComboCtrlV(int keyID) |
static boolean |
isKeyComboCtrlX(int keyID) |
static boolean |
isShiftKeyDown()
Returns true if either shift key is down
|
protected void |
keyTyped(char typedChar,
int keyCode)
Fired when a key is typed (except F11 which toggles full screen).
|
protected void |
mouseClicked(int mouseX,
int mouseY,
int mouseButton)
Called when the mouse is clicked.
|
protected void |
mouseClickMove(int mouseX,
int mouseY,
int clickedMouseButton,
long timeSinceLastClick)
Called when a mouse button is pressed and the mouse is moved around.
|
protected void |
mouseReleased(int mouseX,
int mouseY,
int state)
Called when a mouse button is released.
|
void |
onGuiClosed()
Called when the screen is unloaded.
|
void |
onResize(Minecraft mcIn,
int w,
int h)
Called when the GUI is resized in order to update the world and the resolution
|
protected void |
renderToolTip(ItemStack stack,
int x,
int y) |
void |
sendChatMessage(java.lang.String msg)
Used to add chat messages to the client's GuiChat.
|
void |
sendChatMessage(java.lang.String msg,
boolean addToChat) |
static void |
setClipboardString(java.lang.String copyText)
Stores the given string in the system clipboard
|
void |
setFocused(boolean hasFocusedControlIn) |
void |
setGuiSize(int w,
int h)
Set the gui to the specified width and height
|
protected void |
setText(java.lang.String newChatText,
boolean shouldOverwrite)
Sets the text of the chat
|
void |
setWorldAndResolution(Minecraft mc,
int width,
int height)
Causes the screen to lay out its subcomponents again.
|
void |
updateScreen()
Called from the main game loop to update the screen.
|
drawCenteredString, drawGradientRect, drawHorizontalLine, drawModalRectWithCustomSizedTexture, drawRect, drawScaledCustomSizeModalRect, drawString, drawTexturedModalRect, drawTexturedModalRect, drawTexturedModalRect, drawVerticalLine
public Minecraft mc
protected RenderItem itemRender
public int width
public int height
protected java.util.List<GuiButton> buttonList
protected java.util.List<GuiLabel> labelList
public boolean allowUserInput
protected FontRenderer fontRenderer
protected GuiButton selectedButton
protected boolean keyHandled
protected boolean mouseHandled
public void drawScreen(int mouseX, int mouseY, float partialTicks)
protected void keyTyped(char typedChar, int keyCode) throws java.io.IOException
java.io.IOException
protected <T extends GuiButton> T addButton(T buttonIn)
buttonIn
- The control to addpublic static java.lang.String getClipboardString()
public static void setClipboardString(java.lang.String copyText)
protected void renderToolTip(ItemStack stack, int x, int y)
public java.util.List<java.lang.String> getItemToolTip(ItemStack p_191927_1_)
public void drawHoveringText(java.lang.String text, int x, int y)
public void setFocused(boolean hasFocusedControlIn)
public boolean isFocused()
public void drawHoveringText(java.util.List<java.lang.String> textLines, int x, int y)
protected void drawHoveringText(java.util.List<java.lang.String> textLines, int x, int y, FontRenderer font)
protected void handleComponentHover(ITextComponent component, int x, int y)
protected void setText(java.lang.String newChatText, boolean shouldOverwrite)
public boolean handleComponentClick(ITextComponent component)
public void sendChatMessage(java.lang.String msg)
public void sendChatMessage(java.lang.String msg, boolean addToChat)
protected void mouseClicked(int mouseX, int mouseY, int mouseButton) throws java.io.IOException
java.io.IOException
protected void mouseReleased(int mouseX, int mouseY, int state)
protected void mouseClickMove(int mouseX, int mouseY, int clickedMouseButton, long timeSinceLastClick)
protected void actionPerformed(GuiButton button) throws java.io.IOException
java.io.IOException
public void setWorldAndResolution(Minecraft mc, int width, int height)
public void setGuiSize(int w, int h)
public void initGui()
public void handleInput() throws java.io.IOException
java.io.IOException
public void handleMouseInput() throws java.io.IOException
java.io.IOException
public void handleKeyboardInput() throws java.io.IOException
java.io.IOException
public void updateScreen()
public void onGuiClosed()
public void drawDefaultBackground()
public void drawWorldBackground(int tint)
public void drawBackground(int tint)
public boolean doesGuiPauseGame()
public void confirmClicked(boolean result, int id)
confirmClicked
in interface GuiYesNoCallback
public static boolean isCtrlKeyDown()
public static boolean isShiftKeyDown()
public static boolean isAltKeyDown()
public static boolean isKeyComboCtrlX(int keyID)
public static boolean isKeyComboCtrlV(int keyID)
public static boolean isKeyComboCtrlC(int keyID)
public static boolean isKeyComboCtrlA(int keyID)
public void onResize(Minecraft mcIn, int w, int h)