GuiImmediateContext

public final class GuiImmediateContext(source)

A context containing the constraints of a gui elements, as well as the state of the user interface, relative to that gui element.

Constructors

Link copied to clipboard
public GuiImmediateContext GuiImmediateContext(RenderContext renderContext, Integer renderOffsetX, Integer renderOffsetY, Integer width, Integer height, Integer mouseX, Integer mouseY, Integer absoluteMouseX, Integer absoluteMouseY, Float mouseXHF, Float mouseYHF)

Properties

Link copied to clipboard
private final Integer absoluteMouseX

The position of the mouse, relative to the root element.

Link copied to clipboard
private final Integer absoluteMouseY

The position of the mouse, relative to the root element.

Link copied to clipboard
private final Integer height

The available height for that gui element to render in.

Link copied to clipboard
private final Boolean isHovered
Link copied to clipboard
private final Integer mouseX

The position of the mouse, relative to this gui element.

Link copied to clipboard
private final Float mouseXHF

The position of the mouse, relative to this gui element in as high of a resolution as possible.

Link copied to clipboard
private final Integer mouseY

The position of the mouse, relative to this gui element.

Link copied to clipboard
private final Float mouseYHF

The position of the mouse, relative to this gui element in as high of a resolution as possible.

Link copied to clipboard
Link copied to clipboard
private final Integer renderOffsetX

The current absolute offset for this gui context. This should not need to be accessed, unless you are contacting some API that does not access GlStateManager.

Link copied to clipboard
private final Integer renderOffsetY

The current absolute offset for this gui context. This should not need to be accessed, unless you are contacting some API that does not access GlStateManager.

Link copied to clipboard
private final Integer width

The available width for that gui element to render in.

Functions

Link copied to clipboard
public final Integer getAbsoluteMouseX()

The position of the mouse, relative to the root element.

Link copied to clipboard
public final Integer getAbsoluteMouseY()

The position of the mouse, relative to the root element.

Link copied to clipboard
public final Integer getHeight()

The available height for that gui element to render in.

Link copied to clipboard
public final Integer getMouseX()

The position of the mouse, relative to this gui element.

Link copied to clipboard
public final Float getMouseXHF()

The position of the mouse, relative to this gui element in as high of a resolution as possible.

Link copied to clipboard
public final Integer getMouseY()

The position of the mouse, relative to this gui element.

Link copied to clipboard
public final Float getMouseYHF()

The position of the mouse, relative to this gui element in as high of a resolution as possible.

Link copied to clipboard
Link copied to clipboard
public final Integer getRenderOffsetX()

The current absolute offset for this gui context. This should not need to be accessed, unless you are contacting some API that does not access GlStateManager.

Link copied to clipboard
public final Integer getRenderOffsetY()

The current absolute offset for this gui context. This should not need to be accessed, unless you are contacting some API that does not access GlStateManager.

Link copied to clipboard
public final Integer getWidth()

The available width for that gui element to render in.

Link copied to clipboard
public final Boolean isHovered()

Check if the mouse is positioned within this context.

Link copied to clipboard
public final GuiImmediateContext limitSize(Integer maxWidth, Integer maxHeight)

Construct a new context, which has not been translated, but possible smaller if the arguments demand so.

Link copied to clipboard
public final GuiImmediateContext scaled(Float scale)
Link copied to clipboard
public final GuiImmediateContext translated(Integer xOffset, Integer yOffset, Integer width, Integer height)

Construct a new context representing that is located within this context.

Link copied to clipboard
public final GuiImmediateContext translatedNonRendering(Integer xOffset, Integer yOffset, Integer width, Integer height)

Construct a new context representing that is located within this context. Does not translate the rendering offset.

Link copied to clipboard
public final GuiImmediateContext withBleed(Integer xBleed, Integer yBleed)

Construct a new context that bleeds out over the boundaries of the existing context. This is usually used for more fuzzy click detection.