Package com.igrium.videolib.render
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 ClassesNested 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
ConstructorsConstructorDescriptionConstruct a fullscreen video screen using the default player.VideoScreen
(VideoPlayer player) Construct a fullscreen video screen. -
Method Summary
Modifier and TypeMethodDescriptionprotected VideoScreen.SimpleQuad
calculateQuad
(float aspectRatio) Find the quad that will best fit the image to the screen.void
close()
protected void
drawQuad
(net.minecraft.util.math.Matrix4f matrix, VideoScreen.SimpleQuad quad) int
boolean
playAndShow
(VideoHandle handle) 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
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
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 classnet.minecraft.client.gui.screen.Screen
-
shouldPause
public boolean shouldPause()- Overrides:
shouldPause
in classnet.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 interfacenet.minecraft.client.gui.Drawable
- Overrides:
render
in classnet.minecraft.client.gui.screen.Screen
-
renderBackground
public void renderBackground(net.minecraft.client.util.math.MatrixStack matrices, int vOffset) - Overrides:
renderBackground
in classnet.minecraft.client.gui.screen.Screen
-
close
public void close()- Overrides:
close
in classnet.minecraft.client.gui.screen.Screen
-
drawQuad
-
calculateQuad
Find the quad that will best fit the image to the screen.- Parameters:
aspectRatio
- The video's aspect ratio.- Returns:
- The quad.
-