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.WPlainPanel
- Direct Known Subclasses:
WPlayerInvPanel
A panel that positions children by pixel-perfect positions.
-
Field Summary
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidAdds a new widget to this panel.voidAdds a new widget to this panel and resizes it to a custom size.Gets the layout insets of this panel.Sets the layout insets of this panel.Methods inherited from class io.github.cottonmc.cotton.gui.widget.WPanel
addPainters, canResize, createPeers, cycleFocus, cycleFocus, expandToFit, expandToFit, getBackgroundPainter, hit, layout, onHidden, onShown, paint, remove, setBackgroundPainter, tick, toString, validateMethods inherited from class io.github.cottonmc.cotton.gui.widget.WWidget
addTooltip, canFocus, getAbsoluteX, getAbsoluteY, getHeight, getHost, getParent, getWidth, getX, getY, isActivationKey, isFocused, isWithinBounds, onCharTyped, onClick, onFocusGained, onFocusLost, onKeyPressed, onKeyReleased, onMouseDown, onMouseDrag, onMouseMove, onMouseScroll, onMouseUp, releaseFocus, renderTooltip, requestFocus, setHost, setLocation, setParent, setSize
-
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
-
getInsets
Gets the layout insets of this panel.- Returns:
- the insets
- Since:
- 4.0.0
-
setInsets
Sets the layout insets of this panel.The insets should be set before adding any widgets to this panel.
- Parameters:
insets- the insets, should not be null- Returns:
- this panel
- Since:
- 4.0.0
-