Class CottonClientScreen
java.lang.Object
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
io.github.cottonmc.cotton.gui.client.CottonClientScreen
- All Implemented Interfaces:
io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
,Drawable
,Element
,Navigable
,ParentElement
public class CottonClientScreen
extends Screen
implements io.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
Nested Class Summary
Nested classes/interfaces inherited from class net.minecraft.client.gui.screen.Screen
Screen.SelectedElementNarrationData
-
Field Summary
Modifier and TypeFieldDescriptionprotected GuiDescription
protected int
protected int
The X coordinate of the screen title.protected int
The Y coordinate of the screen title.protected int
Fields inherited from class net.minecraft.client.gui.screen.Screen
client, executor, FOOTER_SEPARATOR_TEXTURE, HEADER_SEPARATOR_TEXTURE, height, INWORLD_FOOTER_SEPARATOR_TEXTURE, INWORLD_HEADER_SEPARATOR_TEXTURE, MENU_BACKGROUND_TEXTURE, narratorToggleButton, PANORAMA_RENDERER, ROTATING_PANORAMA_RENDERER, textRenderer, title, width
Fields inherited from interface net.minecraft.client.gui.Element
MAX_DOUBLE_CLICK_INTERVAL
-
Constructor Summary
ConstructorDescriptionCottonClientScreen
(GuiDescription description) CottonClientScreen
(Text title, GuiDescription description) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
boolean
charTyped
(char ch, int keyCode) void
init()
boolean
keyPressed
(int ch, int keyCode, int modifiers) boolean
keyReleased
(int ch, int keyCode, int modifiers) boolean
mouseClicked
(double mouseX, double mouseY, int mouseButton) boolean
mouseDragged
(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY) void
mouseMoved
(double mouseX, double mouseY) boolean
mouseReleased
(double mouseX, double mouseY, int mouseButton) boolean
mouseScrolled
(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) void
removed()
void
render
(DrawContext context, int mouseX, int mouseY, float partialTicks) protected void
reposition
(int screenWidth, int screenHeight) Repositions the root panel.void
setLastResponder
(@Nullable WWidget lastResponder) void
tick()
Methods inherited from class net.minecraft.client.gui.screen.Screen
addDrawable, addDrawableChild, addScreenNarrations, addSelectableChild, applyBlur, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, blur, children, clearAndInit, clearChildren, clearTooltip, close, filesDragged, findSelectedElementData, getMusic, getNarratedTitle, getNavigationFocus, getTitle, getTooltipFromItem, getUsageNarrationText, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, hasUsageText, init, initTabNavigation, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, narrateScreenIfNarrationEnabled, onDisplayed, refreshNarrator, remove, renderBackground, renderBackgroundTexture, renderDarkening, renderDarkening, renderInGameBackground, renderPanoramaBackground, renderWithTooltip, resize, setInitialFocus, setInitialFocus, setTooltip, setTooltip, setTooltip, setTooltip, shouldCloseOnEsc, shouldPause, switchFocus, updateNarrator, wrapScreenError
Methods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocused
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface net.minecraft.client.gui.navigation.Navigable
getNavigationOrder
Methods inherited from interface net.minecraft.client.gui.ParentElement
getFocusedPath, getNavigationPath, hoveredElement, isFocused, setFocused
-
Field Details
-
description
-
left
protected int left -
top
protected int top -
titleX
protected int titleXThe X coordinate of the screen title. This is relative to the root panel's top-left corner.- Since:
- 2.0.0
-
titleY
protected int titleYThe Y coordinate of the screen title. This is relative to the root panel's top-left corner.- Since:
- 2.0.0
-
lastResponder
-
-
Constructor Details
-
CottonClientScreen
-
CottonClientScreen
-
-
Method Details
-
getDescription
- Specified by:
getDescription
in interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
init
public void init() -
removed
public void removed() -
getLastResponder
- Specified by:
getLastResponder
in interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
setLastResponder
- Specified by:
setLastResponder
in interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
reposition
protected void reposition(int screenWidth, int screenHeight) Repositions the root panel.- Parameters:
screenWidth
- the width of the screenscreenHeight
- the height of the screen
-
render
-
tick
public void tick() -
mouseClicked
public boolean mouseClicked(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseClicked
in interfaceElement
- Specified by:
mouseClicked
in interfaceParentElement
-
mouseReleased
public boolean mouseReleased(double mouseX, double mouseY, int mouseButton) - Specified by:
mouseReleased
in interfaceElement
- Specified by:
mouseReleased
in interfaceParentElement
-
mouseDragged
public boolean mouseDragged(double mouseX, double mouseY, int mouseButton, double deltaX, double deltaY) - Specified by:
mouseDragged
in interfaceElement
- Specified by:
mouseDragged
in interfaceParentElement
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) - Specified by:
mouseScrolled
in interfaceElement
- Specified by:
mouseScrolled
in interfaceParentElement
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMoved
in interfaceElement
-
charTyped
public boolean charTyped(char ch, int keyCode) - Specified by:
charTyped
in interfaceElement
- Specified by:
charTyped
in interfaceParentElement
-
keyPressed
public boolean keyPressed(int ch, int keyCode, int modifiers) - Specified by:
keyPressed
in interfaceElement
- Specified by:
keyPressed
in interfaceParentElement
- Overrides:
keyPressed
in classScreen
-
keyReleased
public boolean keyReleased(int ch, int keyCode, int modifiers) - Specified by:
keyReleased
in interfaceElement
- Specified by:
keyReleased
in interfaceParentElement
-
addElementNarrations
- Overrides:
addElementNarrations
in classScreen
-