Skip to content

Bento Element

This is the base element that all of Bento GUI is built on top of, and it is a complete replacement for Minecraft UI widgets. Below you will find elements that extend this abstract class and do things.

Builder methods:

If a builder method has “getter” or “setter” underneath it, it means that the class has a corresponding getter or setter.

  • position: The position.
    • setter
  • dimensions: The dimensions.
    • setter
  • width: The width.
    • getter / setter
  • height: The height.
    • getter / setter
  • minDimensions: The minimum dimensions.
    • setter
  • minWidth: The minimum width.
    • getter / setter
  • minHeight: The minimum height.
    • getter / setter
  • maxDimensions: The maximum dimensions.
    • setter
  • maxWidth: The maximum width.
    • getter / setter
  • maxHeight: The maximum height.
    • getter / setter
  • margins: The margins.
    • getter / setter
  • padding: The padding.
    • getter / setter
  • alignment: The horizontal and vertical alignments.
    • setter
  • horizontalAlignment: The horizontal alignment.
    • getter / setter
  • verticalAlignment: The vertical alignment.
    • getter / setter
  • alignLeft: Sets the horizontal alignment to the left.
  • alignCenter: Sets the horizontal alignment to the center.
  • alignRight: Sets the horizontal alignment to the right.
  • alignTop: Sets the vertical alignment to the top.
  • alignMiddle: Sets the vertical alignment to the middle.
  • alignBottom: Sets the vertical alignment to the bottom.
  • tooltip: The tooltip.
    • getter / setter
  • tooltipDelay: The tooltip delay before it appears.
    • getter / setter
  • renderOperations: The render operations.
    • setter
  • onHoverChanged: The function to run when this element’s hover state changes.
    • setter
  • onFocusChanged: The function to run when this element’s focus state changes.
    • setter

Class methods:

If a class method has text underneath it, it means there are other variants of that method. Local methods return values in local space, rather than screen space. Inner methods return values that take into account the padding of the element. Auto methods affect whether a length should expand to fill up the available space. Min and max should be self explanatory.

  • getX: Gets the x position.
    • local
  • getY: Gets the y position.
    • local
  • setX: Sets the local x position.
  • setY: Sets the local y position.
  • getWidth: Gets the width.
    • min / max / auto / inner
  • setWidth: Sets the width.
    • min / max / auto
  • getHeight: Gets the height.
    • min / max / auto / inner
  • setHeight: Sets the height.
    • min / max / auto
  • setDimensions: Sets the dimensions.
    • min / max / auto
  • setPositionAndDimensions: Sets the position and dimensions.
  • getLeft: Gets the x position of the left edge.
    • inner / local / local inner
  • getRight: Gets the x position of the right edge.
    • inner / local / local inner
  • getTop: Gets the y position of the top edge.
    • inner / local / local inner
  • getBottom: Gets the y position of the bottom edge.
    • inner / local / local inner
  • isActive: Returns true if this element is active.
  • isEnabled: Returns true if this element is enabled.
  • isVisible: Returns true if this element is visible.
  • isHovered: Returns true if this element is hovered.
  • isFocused: Returns true if this element is focused.
  • isTangible: Returns true if this element is tangible.
  • isRendered: Returns true if this element is rendered.
  • isSelected: Returns true if this element is selected.
  • isKeyboardFocused: Returns true if this element is focused via keyboard.
  • setActive: Sets the active state of this element.
  • setEnabled: Sets the enabled state of this element.
  • setVisible: Sets the visibility of this element.
  • setFocused: Sets the focus state of this element.
  • getParent: Gets the parent of this element.
  • setParent: Sets the parent of this element.
  • getAlpha: Gets the alpha.
  • setAlpha: Sets the alpha.