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
FieldsModifier and TypeFieldDescriptionprotected GuiDescriptionprotected intprotected intThe X coordinate of the screen title.protected intThe Y coordinate of the screen title.protected intFields inherited from class net.minecraft.client.gui.screen.Screen
client, executor, field_60460, FOOTER_SEPARATOR_TEXTURE, HEADER_SEPARATOR_TEXTURE, height, INWORLD_FOOTER_SEPARATOR_TEXTURE, INWORLD_HEADER_SEPARATOR_TEXTURE, MENU_BACKGROUND_TEXTURE, narratorToggleButton, textRenderer, title, width -
Constructor Summary
ConstructorsConstructorDescriptionCottonClientScreen(GuiDescription description) CottonClientScreen(Text title, GuiDescription description) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidbooleanvoidinit()booleankeyPressed(KeyInput input) booleankeyReleased(KeyInput input) booleanmouseClicked(Click click, boolean doubled) booleanmouseDragged(Click click, double offsetX, double offsetY) voidmouseMoved(double mouseX, double mouseY) booleanmouseReleased(Click click) booleanmouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) voidremoved()voidrender(DrawContext context, int mouseX, int mouseY, float partialTicks) protected voidreposition(int screenWidth, int screenHeight) Repositions the root panel.voidsetLastResponder(@Nullable WWidget lastResponder) voidtick()Methods inherited from class net.minecraft.client.gui.screen.Screen
addCrashReportSection, addDrawable, addDrawableChild, addScreenNarrations, addSelectableChild, allowRotatingPanorama, applyBlur, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, blur, canInterruptOtherScreen, children, clearAndInit, clearChildren, close, deferSubtitles, findSelectedElementData, getMusic, getNarratedTitle, getNavigationFocus, getTextRenderer, getTitle, getTooltipFromItem, getUsageNarrationText, handleBasicClickEvent, handleClickEvent, handleClickEvent, handleOpenUri, handleRunCommand, handleTextClick, hasUsageText, init, insertText, isMouseOver, isValidCharacterForName, keepOpenThroughPortal, narrateScreenIfNarrationEnabled, onDisplayed, onFilesDropped, refreshNarrator, refreshWidgetPositions, remove, renderBackground, renderBackgroundTexture, renderDarkening, renderDarkening, renderInGameBackground, renderPanoramaBackground, renderWithTooltip, resize, setInitialFocus, setInitialFocus, setWidgetAlpha, shouldCloseOnEsc, shouldPause, showsStatusEffects, switchFocus, updateNarratorMethods inherited from class net.minecraft.client.gui.AbstractParentElement
getFocused, isDragging, setDragging, setFocusedMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.minecraft.client.gui.Element
getBorder, isClickableMethods inherited from interface net.minecraft.client.gui.navigation.Navigable
getNavigationOrderMethods 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:
getDescriptionin interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
init
public void init() -
removed
public void removed() -
getLastResponder
- Specified by:
getLastResponderin interfaceio.github.cottonmc.cotton.gui.impl.client.CottonScreenImpl
-
setLastResponder
- Specified by:
setLastResponderin 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
- Specified by:
mouseClickedin interfaceElement- Specified by:
mouseClickedin interfaceParentElement
-
mouseReleased
- Specified by:
mouseReleasedin interfaceElement- Specified by:
mouseReleasedin interfaceParentElement
-
mouseDragged
- Specified by:
mouseDraggedin interfaceElement- Specified by:
mouseDraggedin interfaceParentElement
-
mouseScrolled
public boolean mouseScrolled(double mouseX, double mouseY, double horizontalAmount, double verticalAmount) - Specified by:
mouseScrolledin interfaceElement- Specified by:
mouseScrolledin interfaceParentElement
-
mouseMoved
public void mouseMoved(double mouseX, double mouseY) - Specified by:
mouseMovedin interfaceElement
-
charTyped
- Specified by:
charTypedin interfaceElement- Specified by:
charTypedin interfaceParentElement
-
keyPressed
- Specified by:
keyPressedin interfaceElement- Specified by:
keyPressedin interfaceParentElement- Overrides:
keyPressedin classScreen
-
keyReleased
- Specified by:
keyReleasedin interfaceElement- Specified by:
keyReleasedin interfaceParentElement
-
addElementNarrations
- Overrides:
addElementNarrationsin classScreen
-