Interface ConfigEffect
public interface ConfigEffect
Client only: an animated effect for config screens, drawn at any of three layers. Register it with
ConfigEffects.register(net.minecraft.resources.ResourceLocation, net.ixdarklord.coolcatcore.api.config.client.ConfigEffect) and name its id in a theme (ConfigTheme.Builder.effects, or
ConfigBuilder.effects for one config):
// Client setup:
ConfigEffects.register(ResourceLocation.fromNamespaceAndPath("mymod", "snow"), new SnowEffect());
// Anywhere, even common code:
Config.builder("mymod", ConfigScope.CLIENT).effects(ResourceLocation.fromNamespaceAndPath("mymod", "snow"));
Every method is optional. They run every frame on the render thread, so they should be cheap; an effect that throws is
logged once and switched off. Players can turn every effect off, and the Fast graphics preset always does.-
Nested Class Summary
Nested ClassesModifier and TypeInterfaceDescriptionstatic final recordThe screen being drawn.static final recordOne widget, its bounds in GUI pixels as drawn, and its state.static enumThe kinds of widgets effects are told about. -
Method Summary
Modifier and TypeMethodDescriptiondefault voidrenderBackground(net.minecraft.client.gui.GuiGraphics graphics, ConfigEffect.Context context) Behind the panels, over the theme's background (its texture, or the blurred panorama or world).default voidrenderForeground(net.minecraft.client.gui.GuiGraphics graphics, ConfigEffect.Context context) Over the whole screen, panels and widgets included, but under tooltips.default voidrenderWidget(net.minecraft.client.gui.GuiGraphics graphics, ConfigEffect.WidgetContext context) Over one widget, just after it's drawn: buttons, toggles, sliders, text fields, cards and popup panels.
-
Method Details
-
renderBackground
default void renderBackground(net.minecraft.client.gui.GuiGraphics graphics, ConfigEffect.Context context) Behind the panels, over the theme's background (its texture, or the blurred panorama or world). -
renderForeground
default void renderForeground(net.minecraft.client.gui.GuiGraphics graphics, ConfigEffect.Context context) Over the whole screen, panels and widgets included, but under tooltips. -
renderWidget
default void renderWidget(net.minecraft.client.gui.GuiGraphics graphics, ConfigEffect.WidgetContext context) Over one widget, just after it's drawn: buttons, toggles, sliders, text fields, cards and popup panels.
-