Class WPlainPanel
java.lang.Object
io.github.cottonmc.cotton.gui.widget.WWidget
io.github.cottonmc.cotton.gui.widget.WPanel
io.github.cottonmc.cotton.gui.widget.WPanelWithInsets
io.github.cottonmc.cotton.gui.widget.WPlainPanel
- Direct Known Subclasses:
WPlayerInvPanel
A panel that positions children by pixel-perfect positions.
-
Field Summary
Fields inherited from class io.github.cottonmc.cotton.gui.widget.WPanelWithInsets
insets
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
Adds a new widget to this panel.void
Adds a new widget to this panel and resizes it to a custom size.Sets the layout insets of this panel.Methods inherited from class io.github.cottonmc.cotton.gui.widget.WPanelWithInsets
expandToFit, getInsets
Methods inherited from class io.github.cottonmc.cotton.gui.widget.WPanel
addPainters, canResize, expandToFit, getBackgroundPainter, hit, layout, onHidden, onShown, paint, remove, setBackgroundPainter, setHost, streamChildren, tick, toString, validate
Methods inherited from class io.github.cottonmc.cotton.gui.widget.WWidget
addNarrations, addTooltip, canFocus, canHover, getAbsoluteX, getAbsoluteY, getFocusModel, getHeight, getHost, getParent, getWidth, getX, getY, hoveredProperty, isActivationKey, isFocused, isHovered, isNarratable, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, releaseFocus, renderTooltip, requestFocus, setHovered, setLocation, setParent, setSize, shouldRenderInDarkMode
-
Constructor Details
-
WPlainPanel
public WPlainPanel()
-
-
Method Details
-
add
Adds a new widget to this panel.If the widget can be resized, it will be resized to (18, 18).
- Parameters:
w
- the widgetx
- the X positiony
- the Y position
-
add
Adds a new widget to this panel and resizes it to a custom size.- Parameters:
w
- the widgetx
- the X positiony
- the Y positionwidth
- the new widthheight
- the new height
-
setInsets
Description copied from class:WPanelWithInsets
Sets the layout insets of this panel. Subclasses are encouraged to override this method to return their more specific type (such asWGridPanel
).If there are already widgets in this panel when the insets are modified, the panel is resized and the widgets are moved according to the insets.
- Overrides:
setInsets
in classWPanelWithInsets
- Parameters:
insets
- the insets, should not be null- Returns:
- this panel
-