Class GuiView
java.lang.Object
com.render.api.gui.GuiView
- Direct Known Subclasses:
HudPlacementScreenView, RenderlibShowcaseView
Base class for managed full-screen GUI views.
Views use GuiUiMode.MODERN by default. Call
uiMode(GuiUiMode) with GuiUiMode.LEGACY to request the
original retained runtime explicitly.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionprotected abstract voidbuild()Builds the retained component tree for this view.protected final voidfinal voidClears every attached stylesheet.final voidfinal voidclose()Closes this view if it is currently open.final voidcloseDialog(DialogModalComponent dialog) final booleanfinal GuiViewdevtoolsEnabled(boolean devtoolsEnabled) Enables or disables the per-screen devtools overlay.final voidfinal Optional<GuiComponent<?>> Finds a uniquely identified component across the retained content and managed overlay trees.final <C extends GuiComponent<?>>
Optional<C> Finds and type-checks a uniquely identified component across this view.final GuiFontPolicyReturns this view's external-font authorization policy.com.render.api.gui.GuiHostViewfontPolicy(GuiFontPolicy policy) Selects the external-font authorization policy for this view.final booleanisOpen()Returns whether this view is currently open.final GuiMotionPreferenceReturns this view's effective motion preference policy.com.render.api.gui.GuiHostViewmotionPreference(GuiMotionPreference preference) Selects how this view responds to reduced-motion preferences.voidonClose()Hook invoked after the managed screen is removed.final voidopen()Opens this view throughRenderLibGui.final booleanremoveStyleSheet(GuiStyleSheet styleSheet) Removes an attached stylesheet.Returns capabilities and fallbacks for the most recently compiled GUI render graph.final GuiRenderStatsReturns statistics for the most recently compiled GUI render graph.booleanCalled before the managed screen closes through Escape or another vanilla close request.final ContainerComponentroot()final voidshowDialog(DialogModalComponent dialog) final ToastHandleshowToast(ToastComponent toast) final GuiViewsoftwareCursor(GuiImage image, float width, float height, float hotspotX, float hotspotY) Convenience overload for a custom image, dimensions, and hotspot.final GuiViewsoftwareCursor(GuiSoftwareCursor cursor) Selects an optional software cursor for this managed view.final GuiViewstyleSheet(GuiStyleSheet styleSheet) Appends a typed stylesheet to this managed view.final List<GuiStyleSheet> Returns attached stylesheets in cascade order.voidtick()Per-tick hook invoked while the view is open.final GuiUiModeuiMode()Returns the selected retained runtime mode.final GuiViewSelects the retained runtime mode for this managed view.final GuiViewTransitionReturns this host's single retained view-transition controller.
-
Constructor Details
-
GuiView
protected GuiView()
-
-
Method Details
-
open
public final void open()Opens this view throughRenderLibGui. -
close
public final void close()Closes this view if it is currently open. -
isOpen
public final boolean isOpen()Returns whether this view is currently open.- Returns:
truewhen this view is the active managed screen
-
tick
public void tick()Per-tick hook invoked while the view is open. -
onClose
public void onClose()Hook invoked after the managed screen is removed. -
requestClose
public boolean requestClose()Called before the managed screen closes through Escape or another vanilla close request.- Returns:
trueto allow closing, orfalsewhen the view handled the request
-
devtoolsEnabled
Enables or disables the per-screen devtools overlay.- Parameters:
devtoolsEnabled-trueto allow F12 devtools on this view- Returns:
- this view
-
uiMode
-
styleSheet
Appends a typed stylesheet to this managed view.- Parameters:
styleSheet- stylesheet- Returns:
- this view
-
softwareCursor
Selects an optional software cursor for this managed view.The cursor is painted above all RenderLib overlays. The native cursor is hidden only while the custom image is ready and is restored when this view closes or the cursor is cleared.
- Parameters:
cursor- cursor definition, ornullto use the native cursor- Returns:
- this view
-
softwareCursor
public final GuiView softwareCursor(GuiImage image, float width, float height, float hotspotX, float hotspotY) Convenience overload for a custom image, dimensions, and hotspot.- Parameters:
image- cursor imagewidth- painted widthheight- painted heighthotspotX- horizontal hotspothotspotY- vertical hotspot- Returns:
- this view
-
build
protected abstract void build()Builds the retained component tree for this view. -
buildHost
protected final void buildHost() -
root
-
findById
Finds a uniquely identified component across the retained content and managed overlay trees.This is the stable cross-class access point for updating a component without retaining the concrete field that originally created it. Duplicate IDs are rejected.
- Parameters:
id- component identifier- Returns:
- matching component, when present
-
findById
Finds and type-checks a uniquely identified component across this view.- Type Parameters:
C- component type- Parameters:
id- component identifiercomponentType- required component type- Returns:
- matching typed component, when present
-
viewTransition
Returns this host's single retained view-transition controller.- Returns:
- view-transition controller
-
devtoolsEnabled
public final boolean devtoolsEnabled() -
renderCompatibilityReport
Returns capabilities and fallbacks for the most recently compiled GUI render graph.- Returns:
- current GUI render compatibility report
-
renderStats
Returns statistics for the most recently compiled GUI render graph.- Returns:
- current GUI render statistics
-
fontPolicy
Selects the external-font authorization policy for this view.- Parameters:
policy- font policy- Returns:
- this host
-
fontPolicy
Returns this view's external-font authorization policy.- Returns:
- font policy
-
motionPreference
Selects how this view responds to reduced-motion preferences.- Parameters:
preference- motion preference- Returns:
- this host
-
motionPreference
Returns this view's effective motion preference policy.- Returns:
- motion preference
-
uiMode
-
removeStyleSheet
Removes an attached stylesheet.- Parameters:
styleSheet- stylesheet- Returns:
- whether it was attached
-
clearStyleSheets
public final void clearStyleSheets()Clears every attached stylesheet. -
styleSheets
Returns attached stylesheets in cascade order.- Returns:
- immutable stylesheet list
-
showDialog
-
closeDialog
-
showToast
-
clearToasts
public final void clearToasts() -
ensureBuilt
public final void ensureBuilt()
-