Class TitleScreenMuteButton

java.lang.Object
net.minecraft.client.gui.components.AbstractWidget
net.minecraft.client.gui.components.AbstractButton
net.minecraft.client.gui.components.Button
io.github.pixelmk.pixelmkmenu.gui.components.TitleScreenMuteButton
All Implemented Interfaces:
net.minecraft.client.gui.components.events.GuiEventListener, net.minecraft.client.gui.components.Renderable, net.minecraft.client.gui.components.TabOrderedElement, net.minecraft.client.gui.layouts.LayoutElement, net.minecraft.client.gui.narration.NarratableEntry, net.minecraft.client.gui.narration.NarrationSupplier, net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension

public class TitleScreenMuteButton extends net.minecraft.client.gui.components.Button
Mute button present on the title screen.

Mutes the title screen music, can also be used to skip the currently playing track.

  • Nested Class Summary

    Nested classes/interfaces inherited from class net.minecraft.client.gui.components.Button

    net.minecraft.client.gui.components.Button.Builder, net.minecraft.client.gui.components.Button.CreateNarration, net.minecraft.client.gui.components.Button.OnPress

    Nested classes/interfaces inherited from interface net.minecraft.client.gui.narration.NarratableEntry

    net.minecraft.client.gui.narration.NarratableEntry.NarrationPriority
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.components.Button

    BIG_WIDTH, createNarration, DEFAULT_HEIGHT, DEFAULT_NARRATION, DEFAULT_SPACING, DEFAULT_WIDTH, onPress, SMALL_WIDTH

    Fields inherited from class net.minecraft.client.gui.components.AbstractButton

    SPRITES, TEXT_MARGIN

    Fields inherited from class net.minecraft.client.gui.components.AbstractWidget

    active, alpha, height, isHovered, packedFGColor, UNSET_FG_COLOR, visible, width

    Fields inherited from interface net.minecraft.client.gui.components.events.GuiEventListener

    DOUBLE_CLICK_THRESHOLD_MS
  • Constructor Summary

    Constructors
    Constructor
    Description
    TitleScreenMuteButton(int positionX, int positionY)
    Create a mute button at the supplied co'ordinates.
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
     
    void
    renderWidget(net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks)
    Render the mute button.
    void
    setMuted(boolean muted)
    Provided that the music volume is not zero, set the muted state of the button.
    void
    Toggle the muted state of the button.

    Methods inherited from class net.minecraft.client.gui.components.Button

    builder, createNarrationMessage, onPress, updateWidgetNarration

    Methods inherited from class net.minecraft.client.gui.components.AbstractButton

    keyPressed, onClick, renderString

    Methods inherited from class net.minecraft.client.gui.components.AbstractWidget

    clearFGColor, clicked, defaultButtonNarrationText, getBottom, getFGColor, getHeight, getMessage, getRectangle, getRight, getTabOrderGroup, getTooltip, getWidth, getX, getY, isActive, isFocused, isHovered, isHoveredOrFocused, isMouseOver, isValidClickButton, mouseClicked, mouseDragged, mouseReleased, narrationPriority, nextFocusPath, onDrag, onRelease, playDownSound, render, renderScrollingString, renderScrollingString, renderScrollingString, setAlpha, setFGColor, setFocused, setHeight, setMessage, setRectangle, setSize, setTabOrderGroup, setTooltip, setTooltipDelay, setWidth, setX, setY, updateNarration, visitWidgets, wrapDefaultNarrationMessage

    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.components.events.GuiEventListener

    charTyped, getCurrentFocusPath, keyReleased, mouseMoved, mouseScrolled

    Methods inherited from interface net.neoforged.neoforge.client.extensions.IAbstractWidgetExtension

    onClick

    Methods inherited from interface net.minecraft.client.gui.layouts.LayoutElement

    setPosition
  • Constructor Details

    • TitleScreenMuteButton

      public TitleScreenMuteButton(int positionX, int positionY)
      Create a mute button at the supplied co'ordinates.
      Parameters:
      positionX - position on the X axis
      positionY - position on the Y axis
  • Method Details

    • toggleMute

      public void toggleMute()
      Toggle the muted state of the button.
    • setMuted

      public void setMuted(boolean muted)
      Provided that the music volume is not zero, set the muted state of the button.
      Parameters:
      muted - should the Title Screen music be muted?
    • getMuted

      public boolean getMuted()
    • renderWidget

      public void renderWidget(@Nonnull net.minecraft.client.gui.GuiGraphics guiGraphics, int mouseX, int mouseY, float partialTicks)
      Render the mute button. This is a simple blit.

      Because this runs on every tick, the muted property of the mute button is also set here.

      Overrides:
      renderWidget in class net.minecraft.client.gui.components.AbstractButton