Class TScreen
java.lang.Object
com.thecsdev.common.scene.Node<TElement>
com.thecsdev.commonmc.api.client.gui.TElement
com.thecsdev.commonmc.api.client.gui.screen.TScreen
- All Implemented Interfaces:
INode<TElement>, INodeBounded<TElement,Bounds2i>, INodeRenderable<TElement, TGuiGraphics>, Iterable<TElement>, Collection<TElement>
- Direct Known Subclasses:
TCompletableScreen, TScreenPlus
An abstraction layer that represents a game's
Screen.- See Also:
-
Field Summary
Fields inherited from class TElement
eInitialized -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()Callback method that is invoked whenever thisTScreenis closing.protected voidprotected @NotNull TScreenWrapper<?> Creates aTScreenWrapperinstance for thisTScreen.final ObjectProperty<TElement> Returns theObjectPropertyfor the currently focusedTElement.final @NotNull TScreenWrapper<?> Returns theScreenrepresentation of thisTScreen.final @NotNull net.minecraft.client.MinecraftReturns theMinecraftclient instance that last opened thisTScreen, if any.final ObjectProperty<TElement> Returns theObjectPropertyfor the currently mouse-hoveredTElement.protected abstract voidCallback method that is invoked when thisTElementis initializing.booleanReturnstrueif the in-game HUD (heads-up display) GUI should be rendered while thisTScreenis open.final booleanisOpen()booleanReturns abooleanindicating whether the game should be paused while thisTScreenis open.protected voidCallback method that is invoked whenever thisTScreenis opened viaGui.setScreen(Screen).
This takes place beforeinitCallback()is invoked.final booleansendInput(@NotNull TInputContext context) Emulates a user input event for thisTScreen.final NotNullProperty<net.minecraft.network.chat.Component> Returns theNotNullPropertyfor thisTScreen's title.Methods inherited from class TElement
addRel, boundsProperty, clearAndInit, clipsDescendantsProperty, contextMenuProperty, dragEndCallback, dragStartCallback, findElementAt, focusableProperty, focusGainedCallback, focusLostCallback, forEachVisible, getBaseType, getBounds, getContentBounds, getCursor, getSelf, getTooltip, hoverableProperty, hoverGainedCallback, hoverLostCallback, inputCallback, invalidateTooltipCache, isFocusable, isFocused, isHoverable, isHovered, isHoveredOrFocused, isVisible, move, moveChildren, moveTo, postRenderCallback, removeRel, renderCallback, screenProperty, setBounds, setBounds, setBounds, showContextMenu, tickCallback, tooltipProperty, toString, visiblePropertyMethods inherited from class Node
add, addAll, childAddedCallback, childRemovedCallback, clear, contains, containsAll, equals, findChild, findParent, findSibling, forEach, get, getFirst, getLast, getParent, hashCode, indexOf, isEmpty, iterator, parentProperty, remove, remove, remove, removeAll, retainAll, rootProperty, size, toArray, toArray
-
Constructor Details
-
TScreen
public TScreen(@NotNull @NotNull net.minecraft.network.chat.Component title) -
TScreen
public TScreen()
-
-
Method Details
-
createWrapperScreen
Creates aTScreenWrapperinstance for thisTScreen.- See Also:
-
getAsScreen
Returns theScreenrepresentation of thisTScreen. -
getClient
-
titleProperty
Returns theNotNullPropertyfor thisTScreen's title. -
hoveredElementProperty
Returns theObjectPropertyfor the currently mouse-hoveredTElement.- API Note:
- Is read only! Set calls will
throw!
-
focusedElementProperty
Returns theObjectPropertyfor the currently focusedTElement. -
isOpen
@Contract(pure=true) public final boolean isOpen()- See Also:
-
isPauseScreen
-
isAllowingInGameHud
-
sendInput
Emulates a user input event for thisTScreen.- Parameters:
context- Information about the user's input.- Returns:
trueif the input event was handled by a GUI element.- API Note:
- Does not affect the native GUI.
-
initCallback
protected abstract void initCallback()Description copied from class:TElementCallback method that is invoked when thisTElementis initializing. You may override this method to create and add childTElements.- Overrides:
initCallbackin classTElement- See Also:
-
openCallback
Callback method that is invoked whenever thisTScreenis opened viaGui.setScreen(Screen).
This takes place beforeinitCallback()is invoked.- See Also:
-
closeCallback
-
close
-