Class VideoScreen

java.lang.Object
net.minecraft.client.gui.DrawableHelper
net.minecraft.client.gui.AbstractParentElement
net.minecraft.client.gui.screen.Screen
com.igrium.videolib.render.VideoScreen
All Implemented Interfaces:
net.minecraft.client.gui.Drawable, net.minecraft.client.gui.Element, net.minecraft.client.gui.ParentElement

public class VideoScreen extends net.minecraft.client.gui.screen.Screen
Renders a video player in a traditional fullscreen interface.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    protected static final record 
     

    Nested classes/interfaces inherited from class net.minecraft.client.gui.screen.Screen

    net.minecraft.client.gui.screen.Screen.SelectedElementNarrationData
  • Field Summary

    Fields inherited from class net.minecraft.client.gui.screen.Screen

    client, height, itemRenderer, passEvents, textRenderer, title, width

    Fields inherited from class net.minecraft.client.gui.DrawableHelper

    GUI_ICONS_TEXTURE, OPTIONS_BACKGROUND_TEXTURE, STATS_ICON_TEXTURE

    Fields inherited from interface net.minecraft.client.gui.Element

    MAX_DOUBLE_CLICK_INTERVAL
  • Constructor Summary

    Constructors
    Constructor
    Description
    Construct a fullscreen video screen using the default player.
    Construct a fullscreen video screen.
  • Method Summary

    Modifier and Type
    Method
    Description
    calculateQuad(float aspectRatio)
    Find the quad that will best fit the image to the screen.
    void
     
    protected void
    drawQuad(net.minecraft.util.math.Matrix4f matrix, VideoScreen.SimpleQuad quad)
     
    int
     
    boolean
    Load a video and display this screen once it starts playing.
    void
    render(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY, float delta)
     
    void
    renderBackground(net.minecraft.client.util.math.MatrixStack matrices, int vOffset)
     
    void
    setBackgroundColor(int backgroundColor)
     
    void
    setUserClosable(boolean userClosable)
     
    boolean
     
    boolean
     

    Methods inherited from class net.minecraft.client.gui.screen.Screen

    addDrawable, addDrawableChild, addElementNarrations, addScreenNarrations, addSelectableChild, applyKeyPressNarratorDelay, applyMouseMoveNarratorDelay, applyMousePressScrollNarratorDelay, applyNarratorModeChangeDelay, children, clearChildren, filesDragged, findSelectedElementData, getNarratedTitle, getTitle, getTooltipFromItem, handleTextClick, hasAltDown, hasControlDown, hasShiftDown, hide, init, init, insertText, isCopy, isCut, isMouseOver, isPaste, isSelectAll, isValidCharacterForName, keyPressed, narrateScreenIfNarrationEnabled, remove, removed, renderBackground, renderBackgroundTexture, renderOrderedTooltip, renderTextHoverEffect, renderTooltip, renderTooltip, renderTooltip, renderTooltip, resize, sendMessage, sendMessage, tick, updateNarrator, wrapScreenError

    Methods inherited from class net.minecraft.client.gui.AbstractParentElement

    getFocused, isDragging, setDragging, setFocused

    Methods inherited from class net.minecraft.client.gui.DrawableHelper

    drawCenteredText, drawCenteredText, drawCenteredTextWithShadow, drawHorizontalLine, drawSprite, drawStringWithShadow, drawTexture, drawTexture, drawTexture, drawTexture, drawTextWithShadow, drawVerticalLine, drawWithOutline, drawWithShadow, fill, fillGradient, fillGradient, fillGradient, getZOffset, setZOffset

    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.Element

    mouseMoved

    Methods inherited from interface net.minecraft.client.gui.ParentElement

    changeFocus, charTyped, focusOn, hoveredElement, keyReleased, mouseClicked, mouseDragged, mouseReleased, mouseScrolled, setInitialFocus
  • Constructor Details

    • VideoScreen

      public VideoScreen(VideoPlayer player)
      Construct a fullscreen video screen.
      Parameters:
      player - Video player to use.
    • VideoScreen

      public VideoScreen()
      Construct a fullscreen video screen using the default player.
  • Method Details

    • playAndShow

      public boolean playAndShow(VideoHandle handle)
      Load a video and display this screen once it starts playing.
      Parameters:
      handle - The video handle.
      Returns:
      Whether the video could be loaded.
    • getBackgroundColor

      public int getBackgroundColor()
    • setBackgroundColor

      public void setBackgroundColor(int backgroundColor)
    • setUserClosable

      public void setUserClosable(boolean userClosable)
    • shouldCloseOnEsc

      public boolean shouldCloseOnEsc()
      Overrides:
      shouldCloseOnEsc in class net.minecraft.client.gui.screen.Screen
    • shouldPause

      public boolean shouldPause()
      Overrides:
      shouldPause in class net.minecraft.client.gui.screen.Screen
    • render

      public void render(net.minecraft.client.util.math.MatrixStack matrices, int mouseX, int mouseY, float delta)
      Specified by:
      render in interface net.minecraft.client.gui.Drawable
      Overrides:
      render in class net.minecraft.client.gui.screen.Screen
    • renderBackground

      public void renderBackground(net.minecraft.client.util.math.MatrixStack matrices, int vOffset)
      Overrides:
      renderBackground in class net.minecraft.client.gui.screen.Screen
    • close

      public void close()
      Overrides:
      close in class net.minecraft.client.gui.screen.Screen
    • drawQuad

      protected void drawQuad(net.minecraft.util.math.Matrix4f matrix, VideoScreen.SimpleQuad quad)
    • calculateQuad

      protected VideoScreen.SimpleQuad calculateQuad(float aspectRatio)
      Find the quad that will best fit the image to the screen.
      Parameters:
      aspectRatio - The video's aspect ratio.
      Returns:
      The quad.