Package net.storm.api.domain.widgets
Interface IWidget
- All Superinterfaces:
Identifiable,Interactable,RuneLiteWrapper<net.runelite.api.widgets.Widget>,net.runelite.api.widgets.Widget
public interface IWidget
extends net.runelite.api.widgets.Widget, Interactable, Identifiable, RuneLiteWrapper<net.runelite.api.widgets.Widget>
Represents a UI widget (interface component) in the game.
Widgets are the building blocks of the game's user interface. Everything from the inventory grid to dialog boxes to the minimap are composed of widgets. Widgets can contain:
- Text and formatted strings
- Sprites and images
- 3D models (for item icons)
- Child widgets (hierarchical structure)
Widgets are identified by a group ID and component ID. The packed format
combines these: packedId = (groupId << 16) | componentId.
Example usage:
IWidgets widgets = Static.getWidgets();
IWidget closeButton = widgets.get(12, 3, 11);
if (closeButton != null && closeButton.isVisible()) {
closeButton.click();
}
- See Also:
-
Method Summary
Modifier and TypeMethodDescriptionvoidclick()Clicks this widget.createChild(int type) Creates a child widget at the next available index.createChild(int index, int type) Creates a child widget at a specific index.getChild(int index) Gets a child widget by index.IWidget[]Gets all child widgets.Gets the drag parent widget.IWidget[]Gets the dynamically created child widgets.IWidget[]Gets nested child widgets.Gets the parent widget.IWidget[]Gets the statically defined child widgets.booleanChecks if this widget is currently visible on screen.setAnimationId(int animationId) Sets the animation to play on the model.voidsetChildren(net.runelite.api.widgets.Widget[] children) Sets the child widgets.setDragParent(net.runelite.api.widgets.Widget dragParent) Sets the drag parent widget.setFilled(boolean filled) Sets whether shapes should be filled.setFontId(int id) Sets the font ID for text rendering.setHasListener(boolean hasListener) Sets whether this widget has an action listener.setHeightMode(int heightMode) Sets the height sizing mode.setHidden(boolean hidden) Sets whether this widget is hidden.setItemId(int itemId) Sets the item ID for item display widgets.setItemQuantity(int quantity) Sets the item quantity for item display widgets.setItemQuantityMode(int itemQuantityMode) Sets the item quantity display mode.setLineHeight(int lineHeight) Sets the line height for multi-line text.setModelId(int id) Sets the 3D model ID to display.setModelType(int type) Sets the model type.setModelZoom(int modelZoom) Sets the zoom level for the model.Sets the name of this widget (used for menu actions).setOpacity(int transparency) Sets the opacity (transparency) of this widget.setOriginalHeight(int originalHeight) Sets the original height.setOriginalWidth(int originalWidth) Sets the original width.setOriginalX(int originalX) Sets the original X position.setOriginalY(int originalY) Sets the original Y position.setPos(int x, int y) Sets the widget position.setPos(int x, int y, int xMode, int yMode) Sets the widget position with positioning modes.setRotationX(int modelX) Sets the X-axis rotation of the model.setRotationY(int modelY) Sets the Y-axis rotation of the model.setRotationZ(int modelZ) Sets the Z-axis rotation of the model.setScrollHeight(int height) Sets the scrollable content height.setScrollWidth(int width) Sets the scrollable content width.setScrollX(int scrollX) Sets the horizontal scroll position.setScrollY(int scrollY) Sets the vertical scroll position.setSize(int width, int height) Sets the widget size.setSize(int width, int height, int widthMode, int heightMode) Sets the widget size with sizing modes.setSpriteId(int spriteId) Sets the sprite (image) ID to display.setSpriteTiling(boolean tiling) Sets whether the sprite should tile to fill the widget.Sets the displayed text of this widget.setTextColor(int textColor) Sets the text color of this widget.setTextShadowed(boolean shadowed) Sets whether text should have a shadow.setWidthMode(int widthMode) Sets the width sizing mode.setXPositionMode(int xpm) Sets the X position mode.setXTextAlignment(int xta) Sets the horizontal text alignment.setYPositionMode(int ypm) Sets the Y position mode.setYTextAlignment(int yta) Sets the vertical text alignment.Methods inherited from interface net.storm.api.domain.Identifiable
getIdMethods inherited from interface net.storm.api.domain.Interactable
generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, generateMenu, getActionIndex, getActions, getClickPoint, hasAction, hasAction, hasAction, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, interact, isInteractable, isInteractable, isInteractableMethods inherited from interface net.storm.api.domain.RuneLiteWrapper
getWrappedMethods inherited from interface net.runelite.api.widgets.Widget
clearActions, contains, deleteAllChildren, getActions, getAnimationId, getBorderType, getBounds, getCanvasLocation, getClickMask, getContentType, getDragDeadTime, getDragDeadZone, getFont, getFontId, getHeight, getHeightMode, getId, getIndex, getItemId, getItemQuantity, getItemQuantityMode, getLineHeight, getModelId, getModelType, getModelZoom, getName, getNoClickThrough, getNoScrollThrough, getOnInvTransmitListener, getOnKeyListener, getOnLoadListener, getOnOpListener, getOnVarTransmitListener, getOpacity, getOriginalHeight, getOriginalWidth, getOriginalX, getOriginalY, getParentId, getRelativeX, getRelativeY, getRotationX, getRotationY, getRotationZ, getScrollHeight, getScrollWidth, getScrollX, getScrollY, getSpriteId, getSpriteTiling, getTargetPriority, getTargetVerb, getText, getTextColor, getTextShadowed, getType, getVarTransmitTrigger, getWidth, getWidthMode, getXPositionMode, getXTextAlignment, getYPositionMode, getYTextAlignment, hasListener, isFilled, isFlippedHorizontally, isFlippedVertically, isHidden, isIf3, isSelfHidden, revalidate, revalidateScroll, setAction, setBorderType, setClickMask, setContentType, setDragDeadTime, setDragDeadZone, setFlippedHorizontally, setFlippedVertically, setForcedPosition, setHeight, setNoClickThrough, setNoScrollThrough, setOnClickListener, setOnDialogAbortListener, setOnDragCompleteListener, setOnDragListener, setOnHoldListener, setOnKeyListener, setOnMouseLeaveListener, setOnMouseOverListener, setOnMouseRepeatListener, setOnOpListener, setOnReleaseListener, setOnScrollWheelListener, setOnTargetEnterListener, setOnTargetLeaveListener, setOnTimerListener, setOnVarTransmitListener, setRelativeX, setRelativeY, setTargetPriority, setTargetVerb, setType, setVarTransmitTrigger, setWidth
-
Method Details
-
getDynamicChildren
IWidget[] getDynamicChildren()Gets the dynamically created child widgets.Dynamic children are created at runtime (e.g., inventory item slots).
- Specified by:
getDynamicChildrenin interfacenet.runelite.api.widgets.Widget- Returns:
- array of dynamic children, or null if none
-
getStaticChildren
IWidget[] getStaticChildren()Gets the statically defined child widgets.Static children are defined in the interface definition.
- Specified by:
getStaticChildrenin interfacenet.runelite.api.widgets.Widget- Returns:
- array of static children, or null if none
-
getNestedChildren
IWidget[] getNestedChildren()Gets nested child widgets.- Specified by:
getNestedChildrenin interfacenet.runelite.api.widgets.Widget- Returns:
- array of nested children, or null if none
-
setText
Sets the displayed text of this widget.- Specified by:
setTextin interfacenet.runelite.api.widgets.Widget- Parameters:
text- the text to display- Returns:
- this widget for chaining
-
setTextColor
Sets the text color of this widget.- Specified by:
setTextColorin interfacenet.runelite.api.widgets.Widget- Parameters:
textColor- the color in RGB format (0xRRGGBB)- Returns:
- this widget for chaining
-
setOpacity
Sets the opacity (transparency) of this widget.- Specified by:
setOpacityin interfacenet.runelite.api.widgets.Widget- Parameters:
transparency- 0 = fully opaque, 255 = fully transparent- Returns:
- this widget for chaining
-
setName
Sets the name of this widget (used for menu actions).- Specified by:
setNamein interfacenet.runelite.api.widgets.Widget- Parameters:
name- the widget name- Returns:
- this widget for chaining
-
setModelId
Sets the 3D model ID to display.- Specified by:
setModelIdin interfacenet.runelite.api.widgets.Widget- Parameters:
id- the model ID- Returns:
- this widget for chaining
-
setModelType
Sets the model type.- Specified by:
setModelTypein interfacenet.runelite.api.widgets.Widget- Parameters:
type- the model type- Returns:
- this widget for chaining
-
setAnimationId
Sets the animation to play on the model.- Specified by:
setAnimationIdin interfacenet.runelite.api.widgets.Widget- Parameters:
animationId- the animation ID- Returns:
- this widget for chaining
-
setRotationX
Sets the X-axis rotation of the model.- Specified by:
setRotationXin interfacenet.runelite.api.widgets.Widget- Parameters:
modelX- the X rotation- Returns:
- this widget for chaining
-
setRotationY
Sets the Y-axis rotation of the model.- Specified by:
setRotationYin interfacenet.runelite.api.widgets.Widget- Parameters:
modelY- the Y rotation- Returns:
- this widget for chaining
-
setRotationZ
Sets the Z-axis rotation of the model.- Specified by:
setRotationZin interfacenet.runelite.api.widgets.Widget- Parameters:
modelZ- the Z rotation- Returns:
- this widget for chaining
-
setModelZoom
Sets the zoom level for the model.- Specified by:
setModelZoomin interfacenet.runelite.api.widgets.Widget- Parameters:
modelZoom- the zoom level- Returns:
- this widget for chaining
-
setSpriteId
Sets the sprite (image) ID to display.- Specified by:
setSpriteIdin interfacenet.runelite.api.widgets.Widget- Parameters:
spriteId- the sprite ID- Returns:
- this widget for chaining
-
setSpriteTiling
Sets whether the sprite should tile to fill the widget.- Specified by:
setSpriteTilingin interfacenet.runelite.api.widgets.Widget- Parameters:
tiling- true to tile, false to stretch- Returns:
- this widget for chaining
-
setHidden
Sets whether this widget is hidden.- Specified by:
setHiddenin interfacenet.runelite.api.widgets.Widget- Parameters:
hidden- true to hide, false to show- Returns:
- this widget for chaining
-
setItemId
Sets the item ID for item display widgets.- Specified by:
setItemIdin interfacenet.runelite.api.widgets.Widget- Parameters:
itemId- the item ID- Returns:
- this widget for chaining
-
setItemQuantity
Sets the item quantity for item display widgets.- Specified by:
setItemQuantityin interfacenet.runelite.api.widgets.Widget- Parameters:
quantity- the quantity to display- Returns:
- this widget for chaining
-
setScrollX
Sets the horizontal scroll position.- Specified by:
setScrollXin interfacenet.runelite.api.widgets.Widget- Parameters:
scrollX- the X scroll offset- Returns:
- this widget for chaining
-
setScrollY
Sets the vertical scroll position.- Specified by:
setScrollYin interfacenet.runelite.api.widgets.Widget- Parameters:
scrollY- the Y scroll offset- Returns:
- this widget for chaining
-
setScrollWidth
Sets the scrollable content width.- Specified by:
setScrollWidthin interfacenet.runelite.api.widgets.Widget- Parameters:
width- the scroll width- Returns:
- this widget for chaining
-
setScrollHeight
Sets the scrollable content height.- Specified by:
setScrollHeightin interfacenet.runelite.api.widgets.Widget- Parameters:
height- the scroll height- Returns:
- this widget for chaining
-
setOriginalX
Sets the original X position.- Specified by:
setOriginalXin interfacenet.runelite.api.widgets.Widget- Parameters:
originalX- the X position- Returns:
- this widget for chaining
-
setOriginalY
Sets the original Y position.- Specified by:
setOriginalYin interfacenet.runelite.api.widgets.Widget- Parameters:
originalY- the Y position- Returns:
- this widget for chaining
-
setPos
Sets the widget position.- Specified by:
setPosin interfacenet.runelite.api.widgets.Widget- Parameters:
x- the X positiony- the Y position- Returns:
- this widget for chaining
-
setPos
Sets the widget position with positioning modes.- Specified by:
setPosin interfacenet.runelite.api.widgets.Widget- Parameters:
x- the X positiony- the Y positionxMode- the X positioning modeyMode- the Y positioning mode- Returns:
- this widget for chaining
-
setOriginalHeight
Sets the original height.- Specified by:
setOriginalHeightin interfacenet.runelite.api.widgets.Widget- Parameters:
originalHeight- the height- Returns:
- this widget for chaining
-
setOriginalWidth
Sets the original width.- Specified by:
setOriginalWidthin interfacenet.runelite.api.widgets.Widget- Parameters:
originalWidth- the width- Returns:
- this widget for chaining
-
setSize
Sets the widget size.- Specified by:
setSizein interfacenet.runelite.api.widgets.Widget- Parameters:
width- the widthheight- the height- Returns:
- this widget for chaining
-
setSize
Sets the widget size with sizing modes.- Specified by:
setSizein interfacenet.runelite.api.widgets.Widget- Parameters:
width- the widthheight- the heightwidthMode- the width sizing modeheightMode- the height sizing mode- Returns:
- this widget for chaining
-
createChild
Creates a child widget at a specific index.- Specified by:
createChildin interfacenet.runelite.api.widgets.Widget- Parameters:
index- the child indextype- the widget type- Returns:
- the created child widget
-
createChild
Creates a child widget at the next available index.- Specified by:
createChildin interfacenet.runelite.api.widgets.Widget- Parameters:
type- the widget type- Returns:
- the created child widget
-
setHasListener
Sets whether this widget has an action listener.- Specified by:
setHasListenerin interfacenet.runelite.api.widgets.Widget- Parameters:
hasListener- true if it has a listener- Returns:
- this widget for chaining
-
setFontId
Sets the font ID for text rendering.- Specified by:
setFontIdin interfacenet.runelite.api.widgets.Widget- Parameters:
id- the font ID- Returns:
- this widget for chaining
-
setTextShadowed
Sets whether text should have a shadow.- Specified by:
setTextShadowedin interfacenet.runelite.api.widgets.Widget- Parameters:
shadowed- true for shadowed text- Returns:
- this widget for chaining
-
setItemQuantityMode
Sets the item quantity display mode.- Specified by:
setItemQuantityModein interfacenet.runelite.api.widgets.Widget- Parameters:
itemQuantityMode- the display mode- Returns:
- this widget for chaining
-
setXPositionMode
Sets the X position mode.- Specified by:
setXPositionModein interfacenet.runelite.api.widgets.Widget- Parameters:
xpm- the X position mode- Returns:
- this widget for chaining
-
setYPositionMode
Sets the Y position mode.- Specified by:
setYPositionModein interfacenet.runelite.api.widgets.Widget- Parameters:
ypm- the Y position mode- Returns:
- this widget for chaining
-
setLineHeight
Sets the line height for multi-line text.- Specified by:
setLineHeightin interfacenet.runelite.api.widgets.Widget- Parameters:
lineHeight- the line height- Returns:
- this widget for chaining
-
setXTextAlignment
Sets the horizontal text alignment.- Specified by:
setXTextAlignmentin interfacenet.runelite.api.widgets.Widget- Parameters:
xta- the X text alignment- Returns:
- this widget for chaining
-
setYTextAlignment
Sets the vertical text alignment.- Specified by:
setYTextAlignmentin interfacenet.runelite.api.widgets.Widget- Parameters:
yta- the Y text alignment- Returns:
- this widget for chaining
-
setWidthMode
Sets the width sizing mode.- Specified by:
setWidthModein interfacenet.runelite.api.widgets.Widget- Parameters:
widthMode- the width mode- Returns:
- this widget for chaining
-
setHeightMode
Sets the height sizing mode.- Specified by:
setHeightModein interfacenet.runelite.api.widgets.Widget- Parameters:
heightMode- the height mode- Returns:
- this widget for chaining
-
setFilled
Sets whether shapes should be filled.- Specified by:
setFilledin interfacenet.runelite.api.widgets.Widget- Parameters:
filled- true to fill shapes- Returns:
- this widget for chaining
-
getParent
IWidget getParent()Gets the parent widget.- Specified by:
getParentin interfacenet.runelite.api.widgets.Widget- Returns:
- the parent widget, or null if this is a root widget
-
getDragParent
IWidget getDragParent()Gets the drag parent widget.- Specified by:
getDragParentin interfacenet.runelite.api.widgets.Widget- Returns:
- the drag parent
-
setDragParent
Sets the drag parent widget.- Specified by:
setDragParentin interfacenet.runelite.api.widgets.Widget- Parameters:
dragParent- the drag parent- Returns:
- this widget for chaining
-
getChild
Gets a child widget by index.- Specified by:
getChildin interfacenet.runelite.api.widgets.Widget- Parameters:
index- the child index- Returns:
- the child widget, or null if not found
-
getChildren
IWidget[] getChildren()Gets all child widgets.- Specified by:
getChildrenin interfacenet.runelite.api.widgets.Widget- Returns:
- array of child widgets, or null if none
-
setChildren
void setChildren(net.runelite.api.widgets.Widget[] children) Sets the child widgets.- Specified by:
setChildrenin interfacenet.runelite.api.widgets.Widget- Parameters:
children- the child widgets
-
isVisible
boolean isVisible()Checks if this widget is currently visible on screen.A widget is visible if it and all its parents are not hidden and the interface is open.
- Returns:
- true if visible
-
click
void click()Clicks this widget.This performs a left-click interaction on the widget.
-