Package net.runelite.api.widgets
Interface Widget
-
public interface Widget
Represents an on-screen UI element that is drawn on the canvas.It should be noted that most RuneLite-added elements are not Widgets, but are an Overlay. Notable exceptions include bank tag tabs and chatbox inputs
Examples of Widgets include:
- The fairy ring configuration selector
- The mini-map
- The bank inventory
For a more complete idea of what is classified as a widget, see
WidgetID
.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Deprecated Methods Modifier and Type Method Description void
clearActions()
Clear the menu options on a widget.boolean
contains(Point point)
Checks if the passed canvas points is inside of this widget'sbounds
Widget
createChild(int type)
Creates a dynamic widget child at the end of the children listWidget
createChild(int index, int type)
Creates a dynamic widget childvoid
deleteAllChildren()
Removes all of this widget's dynamic childrenString[]
getActions()
Gets the menu options available on the widget as a sparse array.int
getAnimationId()
Gets the sequence ID used to animate the model in the widgetint
getBorderType()
Returns the border type of item/sprite on the widget 0 - No border 1 - 1px black border 2 - 1px black under 1px white border (selected item)Rectangle
getBounds()
Gets the area where the widget is drawn on the canvas.Point
getCanvasLocation()
Gets the location the widget is being drawn on the canvas.Widget
getChild(int index)
Gets a dynamic child by indexWidget[]
getChildren()
Gets the dynamic children of this widget in a sparse arrayint
getClickMask()
Gets the current click configuration of the widget.int
getContentType()
Gets the type of content displayed by the widget.int
getDragDeadTime()
Returns the widget drag dead timeint
getDragDeadZone()
Returns the widget drag dead zoneWidget
getDragParent()
Container this can be dragged inWidget[]
getDynamicChildren()
Gets all dynamic children.FontTypeFace
getFont()
Gets the font that this widget usesint
getFontId()
Returns the archive id of the font usedint
getHeight()
Gets the height of the widget.int
getHeightMode()
Gets the mode controlling widget widthint
getId()
Gets the widgets ID.int
getIndex()
The index of this widget in it's parent's children arrayint
getItemId()
Gets the item ID displayed by the widget.int
getItemQuantity()
Gets the quantity of the item displayed by the widget.int
getItemQuantityMode()
Returns widgetItemQuantityMode
.int
getLineHeight()
Get the line height for this widget.int
getModelId()
Gets the Model/NPC/Item ID displayed in the widget.int
getModelType()
Gets the model type of the widget.int
getModelZoom()
Gets the amount zoomed in on the model displayed in the widget.String
getName()
Gets the name "op base" of the widget.Widget[]
getNestedChildren()
Gets all nested children.boolean
getNoClickThrough()
Can widgets under this widgets be clicked in this widgets bounding boxboolean
getNoScrollThrough()
Can widgets under this widgets be scrolled in this widgets bounding boxObject[]
getOnInvTransmitListener()
Gets the script and arguments to be ran when one of the listened for inventories changes.Object[]
getOnKeyListener()
Gets the script and arguments to be ran when a key is pressed.Object[]
getOnLoadListener()
Gets the script and arguments to be ran when a interface is loaded.Object[]
getOnOpListener()
Gets the script and arguments to be ran when a menu action is clicked.Object[]
getOnVarTransmitListener()
Gets the script and arguments to be ran when one of the listened for vars changes.int
getOpacity()
Gets the transparency of the rectangleint
getOriginalHeight()
Gets the height coordinate of this widget before being adjusted bygetHeightMode()
int
getOriginalWidth()
Gets the width coordinate of this widget before being adjusted bygetWidthMode()
int
getOriginalX()
Gets the X coordinate of this widget before being adjusted bygetXPositionMode()
}.int
getOriginalY()
Gets the Y coordinate of this widget before being adjusted bygetYPositionMode()
}Widget
getParent()
Gets the parent widget, if this widget is a child.int
getParentId()
Gets the ID of the parent widget.int
getRelativeX()
Gets the relative x-axis coordinate to the widgets parent.int
getRelativeY()
Gets the relative y-axis coordinate to the widgets parent.@org.jetbrains.annotations.Range(from=0L, to=2047L) int
getRotationX()
Gets the x rotation of the model displayed in the widget.@org.jetbrains.annotations.Range(from=0L, to=2047L) int
getRotationY()
Gets the y rotation of the model displayed in the widget.@org.jetbrains.annotations.Range(from=0L, to=2047L) int
getRotationZ()
Gets the z rotation of the model displayed in the widget.int
getScrollHeight()
Gets the size of the widget's viewport in the Y axisint
getScrollWidth()
Gets the size of the widget's viewport in the X axisint
getScrollX()
Gets the amount of pixels the widget is scrolled in the X axisint
getScrollY()
Gets the amount of pixels the widget is scrolled in the Y axisint
getSpriteId()
Gets the sprite ID displayed in the widget.boolean
getSpriteTiling()
Gets if sprites are repeated or stretchedWidget[]
getStaticChildren()
Gets all static children.String
getTargetVerb()
Verb for spell targetsString
getText()
Gets the text displayed on this widget.int
getTextColor()
Gets the color as an RGB value.boolean
getTextShadowed()
Returns if text is shadowedint
getType()
Gets the type of the widget.int[]
getVarTransmitTrigger()
VarPlayer
s that triggers this widgets varTransmitListenerint
getWidth()
Gets the width of the widget.int
getWidthMode()
Gets the mode controlling widget widthint
getXPositionMode()
Gets the mode that the X position is calculated from the original X positionint
getXTextAlignment()
Gets the X axis text position modeint
getYPositionMode()
Gets the mode that the Y position is calculated from the original Y positionint
getYTextAlignment()
Gets the Y axis text position modeboolean
hasListener()
If this widget has any listeners on itboolean
isFilled()
Gets if the rectangle is filled or just strokedboolean
isHidden()
Checks whether this widget or any of its parents are hidden.boolean
isIf3()
This is true if the widget is from an if3 interface, or is dynamically createdboolean
isSelfHidden()
Checks whether this widget is hidden, not taking into account any parent hidden states.void
revalidate()
Recomputes this widget's x/y/w/h, excluding scrollvoid
revalidateScroll()
Recomputes this widget's group's x/y/w/h including scrollvoid
setAction(int index, String action)
Creates a menu option on the widgetWidget
setAnimationId(int animationId)
Sets the sequence ID used to animate the model in the widgetvoid
setBorderType(int thickness)
void
setChildren(Widget[] children)
Sets the dynamic children sparse arrayWidget
setClickMask(int mask)
Sets the click configuration of the widget.Widget
setContentType(int contentType)
Sets the type of content displayed by the widget.void
setDragDeadTime(int deadTime)
Sets the widget drag dead timevoid
setDragDeadZone(int deadZone)
Sets the widget drag dead zoneWidget
setDragParent(Widget dragParent)
Container this can be dragged inWidget
setFilled(boolean filled)
Sets if the rectangle is filled or just strokedWidget
setFontId(int id)
Sets the archive id of the fontvoid
setForcedPosition(int x, int y)
Set a forced position for the widget.Widget
setHasListener(boolean hasListener)
Sets if the widget has any listeners.void
setHeight(int height)
Deprecated.Widget
setHeightMode(int heightMode)
Sets the mode controlling widget width.Widget
setHidden(boolean hidden)
Sets the self-hidden state of this widget.Widget
setItemId(int itemId)
Sets the item ID displayed by the widget.Widget
setItemQuantity(int quantity)
Sets the item quantity displayed by the widget.Widget
setItemQuantityMode(int itemQuantityMode)
Sets the widgetItemQuantityMode
Widget
setLineHeight(int lineHeight)
Set the line height for this widget.Widget
setModelId(int id)
Sets the Model/NPC/Item ID displayed in the widget.Widget
setModelType(int type)
Sets the model type of the widget.Widget
setModelZoom(int modelZoom)
Sets the amount zoomed in on the model displayed in the widget.Widget
setName(String name)
Sets the name of the widget.void
setNoClickThrough(boolean noClickThrough)
Can widgets under this widgets be clicked in this widgets bounding boxvoid
setNoScrollThrough(boolean noScrollThrough)
Can widgets under this widgets be scrolled in this widgets bounding boxvoid
setOnClickListener(Object... args)
Sets a script to be ran the first client tick the mouse is held ontop of this widgetvoid
setOnDialogAbortListener(Object... args)
Sets a script to be ran when the dialog is canceledvoid
setOnDragCompleteListener(Object... args)
Sets a script to be ran when a drag operation is finished on this widgetvoid
setOnDragListener(Object... args)
Sets a script to be ran when this widget moves due to a dragvoid
setOnHoldListener(Object... args)
Sets a script to be ran the every client tick the mouse is held ontop of this widget, except the first client tick.void
setOnKeyListener(Object... args)
Sets a script to be ran on key inputvoid
setOnMouseLeaveListener(Object... args)
Sets a script to be ran when the mouse leaves the widget boundsvoid
setOnMouseOverListener(Object... args)
Sets a script to be ran when the mouse enters the widget boundsvoid
setOnMouseRepeatListener(Object... args)
Sets a script to be ran every client tick when the mouse is in the widget boundsvoid
setOnOpListener(Object... args)
Sets a script to be ran when the a menu action is clicked.void
setOnReleaseListener(Object... args)
Sets a script to be ran the first client tick the mouse is not held ontop of this widgetvoid
setOnScrollWheelListener(Object... args)
Sets a script to be ran when the mouse is scrolled when on the widgetvoid
setOnTargetEnterListener(Object... args)
Sets a script to be ran when the target mode has been activated for this widgetvoid
setOnTargetLeaveListener(Object... args)
Sets a script to be ran when the target mode has been deactivated for this widgetvoid
setOnTimerListener(Object... args)
Sets a script to be ran every client tickvoid
setOnVarTransmitListener(Object... args)
Sets a script to be ran when a varplayer changesWidget
setOpacity(int transparency)
Sets the transparency of the rectangleWidget
setOriginalHeight(int originalHeight)
Sets the height input to theWidgetSizeMode
.Widget
setOriginalWidth(int originalWidth)
Sets the width input to theWidgetSizeMode
.Widget
setOriginalX(int originalX)
Sets the X input to theWidgetPositionMode
.Widget
setOriginalY(int originalY)
Sets the Y input to theWidgetPositionMode
.Widget
setPos(int x, int y)
Sets the X/Y coordinatesWidget
setPos(int x, int y, int xMode, int yMode)
void
setRelativeX(int x)
Deprecated.void
setRelativeY(int y)
Deprecated.Widget
setRotationX(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelX)
Sets the x rotation of the model displayed in the widget.Widget
setRotationY(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelY)
Sets the y rotation of the model displayed in the widget.Widget
setRotationZ(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelZ)
Sets the z rotation of the model displayed in the widget.Widget
setScrollHeight(int height)
Sets the size of the widget's viewport in the Y axisWidget
setScrollWidth(int width)
Sets the size of the widget's viewport in the X axisWidget
setScrollX(int scrollX)
Sets the amount of pixels the widget is scrolled in the X axisWidget
setScrollY(int scrollY)
sets the amount of pixels the widget is scrolled in the Y axisWidget
setSize(int width, int height)
Widget
setSize(int width, int height, int widthMode, int heightMode)
Widget
setSpriteId(int spriteId)
Sets the sprite ID displayed in the widget.Widget
setSpriteTiling(boolean tiling)
Sets if sprites are repeated or stretchedvoid
setTargetVerb(String targetVerb)
Verb for spell targetsWidget
setText(String text)
Sets the text displayed on this widget.Widget
setTextColor(int textColor)
Sets the RGB color of the displayed text or rectangle.Widget
setTextShadowed(boolean shadowed)
Sets if text should be shadowedvoid
setType(int type)
Sets the type of the widget.void
setVarTransmitTrigger(int... trigger)
VarPlayer
s that triggers this widgets varTransmitListenervoid
setWidth(int width)
Deprecated.Widget
setWidthMode(int widthMode)
Sets the mode controlling widget width.Widget
setXPositionMode(int xpm)
Sets the mode that the X position is calculated from the original X position.Widget
setXTextAlignment(int xta)
Sets the X axis text position modeWidget
setYPositionMode(int ypm)
Sets the mode that the Y position is calculated from the original Y position.Widget
setYTextAlignment(int yta)
Sets the Y axis text position mode
-
-
-
Method Detail
-
getId
@Component int getId()
Gets the widgets ID.- See Also:
WidgetID
-
getType
int getType()
Gets the type of the widget.- See Also:
WidgetType
-
setType
void setType(int type)
Sets the type of the widget.- See Also:
WidgetType
-
getContentType
int getContentType()
Gets the type of content displayed by the widget.
-
setContentType
Widget setContentType(int contentType)
Sets the type of content displayed by the widget.
-
getClickMask
int getClickMask()
Gets the current click configuration of the widget.- See Also:
WidgetConfig
-
setClickMask
Widget setClickMask(int mask)
Sets the click configuration of the widget.- See Also:
WidgetConfig
-
getParent
Widget getParent()
Gets the parent widget, if this widget is a child.- Returns:
- the parent widget, or null
-
getParentId
int getParentId()
Gets the ID of the parent widget.- Returns:
- the parent ID, or -1 if this widget is not a child
-
getChild
@Nullable Widget getChild(int index)
Gets a dynamic child by index
-
getChildren
@Nullable Widget[] getChildren()
Gets the dynamic children of this widget in a sparse array
-
setChildren
void setChildren(Widget[] children)
Sets the dynamic children sparse array
-
getDynamicChildren
Widget[] getDynamicChildren()
Gets all dynamic children.- Returns:
- the dynamic children
-
getStaticChildren
Widget[] getStaticChildren()
Gets all static children.- Returns:
- the static children
-
getNestedChildren
Widget[] getNestedChildren()
Gets all nested children.- Returns:
- the nested children
-
getRelativeX
int getRelativeX()
Gets the relative x-axis coordinate to the widgets parent.- Returns:
- the relative x-axis coordinate
-
setRelativeX
@Deprecated void setRelativeX(int x)
Deprecated.Sets the relative x-axis coordinate to the widgets parent. You do not want to use this. UsesetOriginalX(int)
,setXPositionMode(int)
andrevalidate()
. Almost any interaction with this widget from a clientscript will recalculate this value.
-
getRelativeY
int getRelativeY()
Gets the relative y-axis coordinate to the widgets parent.- Returns:
- the relative coordinate
-
setRelativeY
@Deprecated void setRelativeY(int y)
Deprecated.Sets the relative y-axis coordinate to the widgets parent. You do not want to use this. UsesetOriginalY(int)
,setYPositionMode(int)
andrevalidate()
. Almost any interaction with this widget from a clientscript will recalculate this value.
-
setForcedPosition
void setForcedPosition(int x, int y)
Set a forced position for the widget. This position overrides the relative x/y for the widget, even if the widget is revalidated. To clear the forced position pass -1 for x/y.- Parameters:
x
- x pos relative to the parenty
- y pos relative to the parent
-
getText
String getText()
Gets the text displayed on this widget.- Returns:
- the displayed text
-
setText
Widget setText(String text)
Sets the text displayed on this widget.- Parameters:
text
- the text to display
-
getTextColor
int getTextColor()
Gets the color as an RGB value.- Returns:
- RGB24 color
- See Also:
Color.getRGB()
-
setTextColor
Widget setTextColor(int textColor)
Sets the RGB color of the displayed text or rectangle.- Parameters:
textColor
- RGB24 color- See Also:
Color.getRGB()
-
getOpacity
int getOpacity()
Gets the transparency of the rectangle- Returns:
- 0 = fully opaque, 255 = fully transparent
-
setOpacity
Widget setOpacity(int transparency)
Sets the transparency of the rectangle- Parameters:
transparency
- 0 = fully opaque, 255 = fully transparent
-
getName
String getName()
Gets the name "op base" of the widget.The name of the widget is used in the tooltip when an action is available. For example, the widget that activates quick prayers has the name "Quick-prayers" so when hovering there is a tooltip that says "Activate Quick-prayers".
- Returns:
- the name
-
getModelId
int getModelId()
Gets the Model/NPC/Item ID displayed in the widget.- See Also:
getModelType()
-
setModelId
Widget setModelId(int id)
Sets the Model/NPC/Item ID displayed in the widget.- See Also:
WidgetModelType
-
getModelType
int getModelType()
Gets the model type of the widget.- See Also:
WidgetModelType
-
setModelType
Widget setModelType(int type)
Sets the model type of the widget.- Parameters:
type
- the new model type- See Also:
WidgetModelType
-
getAnimationId
int getAnimationId()
Gets the sequence ID used to animate the model in the widget- See Also:
AnimationID
-
setAnimationId
Widget setAnimationId(int animationId)
Sets the sequence ID used to animate the model in the widget- See Also:
AnimationID
-
getRotationX
@org.jetbrains.annotations.Range(from=0L, to=2047L) int getRotationX()
Gets the x rotation of the model displayed in the widget. 0 = no rotation, 2047 = full rotation
-
setRotationX
Widget setRotationX(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelX)
Sets the x rotation of the model displayed in the widget.
Note: Setting this value outside of the input range defined bygetRotationX()
will cause a client crash.- Parameters:
modelX
- the new model x rotation value
-
getRotationY
@org.jetbrains.annotations.Range(from=0L, to=2047L) int getRotationY()
Gets the y rotation of the model displayed in the widget. 0 = no rotation, 2047 = full rotation
-
setRotationY
Widget setRotationY(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelY)
Sets the y rotation of the model displayed in the widget.
Note: Setting this value outside of the input range defined bygetRotationY()
will cause a client crash.- Parameters:
modelY
- the new model y rotation value
-
getRotationZ
@org.jetbrains.annotations.Range(from=0L, to=2047L) int getRotationZ()
Gets the z rotation of the model displayed in the widget. 0 = no rotation, 2047 = full rotation
-
setRotationZ
Widget setRotationZ(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelZ)
Sets the z rotation of the model displayed in the widget.
Note: Setting this value outside of the input range defined bygetRotationZ()
will cause a client crash.- Parameters:
modelZ
- the new model z rotation value
-
getModelZoom
int getModelZoom()
Gets the amount zoomed in on the model displayed in the widget.
-
setModelZoom
Widget setModelZoom(int modelZoom)
Sets the amount zoomed in on the model displayed in the widget.- Parameters:
modelZoom
- the new model zoom value
-
getSpriteId
int getSpriteId()
Gets the sprite ID displayed in the widget.- Returns:
- the sprite ID
- See Also:
SpriteID
-
getSpriteTiling
boolean getSpriteTiling()
Gets if sprites are repeated or stretched
-
setSpriteTiling
Widget setSpriteTiling(boolean tiling)
Sets if sprites are repeated or stretched
-
setSpriteId
Widget setSpriteId(int spriteId)
Sets the sprite ID displayed in the widget.- Parameters:
spriteId
- the sprite ID- See Also:
SpriteID
-
isHidden
boolean isHidden()
Checks whether this widget or any of its parents are hidden. This must be ran on the client thread- Returns:
- true if this widget or any parent is hidden, false otherwise
-
isSelfHidden
boolean isSelfHidden()
Checks whether this widget is hidden, not taking into account any parent hidden states.- Returns:
- true if this widget is hidden, false otherwise
-
setHidden
Widget setHidden(boolean hidden)
Sets the self-hidden state of this widget.- Parameters:
hidden
- new hidden state
-
getIndex
int getIndex()
The index of this widget in it's parent's children array
-
getCanvasLocation
Point getCanvasLocation()
Gets the location the widget is being drawn on the canvas.This method accounts for the relative coordinates and bounds of any parent widgets.
- Returns:
- the upper-left coordinate of where this widget is drawn
-
getWidth
int getWidth()
Gets the width of the widget.If this widget is storing any
WidgetItem
s, this value is used to store the number of item slot columns.- Returns:
- the width
-
setWidth
@Deprecated void setWidth(int width)
Deprecated.Sets the width of the widget. You do not want to use this. UsesetOriginalWidth(int)
,setWidthMode(int)
andrevalidate()
. Almost any interaction with this widget from a clientscript will recalculate this value.
-
getHeight
int getHeight()
Gets the height of the widget.- Returns:
- the height
-
setHeight
@Deprecated void setHeight(int height)
Deprecated.Sets the height of the widget. You do not want to use this. UsesetOriginalHeight(int)
,setHeightMode(int)
andrevalidate()
. Almost any interaction with this widget from a clientscript will recalculate this value.
-
getBounds
Rectangle getBounds()
Gets the area where the widget is drawn on the canvas.- Returns:
- the occupied area of the widget
-
getItemId
int getItemId()
Gets the item ID displayed by the widget.- Returns:
- the item ID
-
setItemId
Widget setItemId(int itemId)
Sets the item ID displayed by the widget.- Parameters:
itemId
- the item ID
-
getItemQuantity
int getItemQuantity()
Gets the quantity of the item displayed by the widget.- Returns:
- the item quantity
-
setItemQuantity
Widget setItemQuantity(int quantity)
Sets the item quantity displayed by the widget.- Parameters:
quantity
- the quantity of the item
-
contains
boolean contains(Point point)
Checks if the passed canvas points is inside of this widget'sbounds
- Parameters:
point
- the canvas point- Returns:
- true if this widget contains the point, false otherwise
-
getScrollX
int getScrollX()
Gets the amount of pixels the widget is scrolled in the X axis
-
setScrollX
Widget setScrollX(int scrollX)
Sets the amount of pixels the widget is scrolled in the X axis
-
getScrollY
int getScrollY()
Gets the amount of pixels the widget is scrolled in the Y axis
-
setScrollY
Widget setScrollY(int scrollY)
sets the amount of pixels the widget is scrolled in the Y axis
-
getScrollWidth
int getScrollWidth()
Gets the size of the widget's viewport in the X axis
-
setScrollWidth
Widget setScrollWidth(int width)
Sets the size of the widget's viewport in the X axis
-
getScrollHeight
int getScrollHeight()
Gets the size of the widget's viewport in the Y axis
-
setScrollHeight
Widget setScrollHeight(int height)
Sets the size of the widget's viewport in the Y axis
-
getOriginalX
int getOriginalX()
Gets the X coordinate of this widget before being adjusted bygetXPositionMode()
}.
-
setOriginalX
Widget setOriginalX(int originalX)
Sets the X input to theWidgetPositionMode
.revalidate()
must be called for the new values to take effect.- See Also:
setXPositionMode(int)
-
getOriginalY
int getOriginalY()
Gets the Y coordinate of this widget before being adjusted bygetYPositionMode()
}
-
setOriginalY
Widget setOriginalY(int originalY)
Sets the Y input to theWidgetPositionMode
.revalidate()
must be called for the new values to take effect.- See Also:
setYPositionMode(int)
-
setPos
Widget setPos(int x, int y)
Sets the X/Y coordinates
-
setPos
Widget setPos(int x, int y, int xMode, int yMode)
-
getOriginalHeight
int getOriginalHeight()
Gets the height coordinate of this widget before being adjusted bygetHeightMode()
-
setOriginalHeight
Widget setOriginalHeight(int originalHeight)
Sets the height input to theWidgetSizeMode
.revalidate()
must be called for the new values to take effect.- See Also:
setHeightMode(int)
-
getOriginalWidth
int getOriginalWidth()
Gets the width coordinate of this widget before being adjusted bygetWidthMode()
-
setOriginalWidth
Widget setOriginalWidth(int originalWidth)
Sets the width input to theWidgetSizeMode
.revalidate()
must be called for the new values to take effect.- See Also:
setWidthMode(int)
-
setSize
Widget setSize(int width, int height)
-
setSize
Widget setSize(int width, int height, int widthMode, int heightMode)
-
getActions
@Nullable String[] getActions()
Gets the menu options available on the widget as a sparse array.
-
createChild
Widget createChild(int index, int type)
Creates a dynamic widget child- Parameters:
index
- the index of the new widget in the children list or -1 to append to the backtype
- theWidgetType
of the widget
-
createChild
Widget createChild(int type)
Creates a dynamic widget child at the end of the children list- Parameters:
type
- theWidgetType
of the widget
-
deleteAllChildren
void deleteAllChildren()
Removes all of this widget's dynamic children
-
setAction
void setAction(int index, String action)
Creates a menu option on the widget- Parameters:
index
- The index of the menuaction
- The verb to be displayed next to the widget's name in the context menu
-
clearActions
void clearActions()
Clear the menu options on a widget.
-
setOnOpListener
void setOnOpListener(Object... args)
Sets a script to be ran when the a menu action is clicked. hasListener must be true for this to take effect- Parameters:
args
- A ScriptID, then the args for the script
-
setOnDialogAbortListener
void setOnDialogAbortListener(Object... args)
Sets a script to be ran when the dialog is canceled- Parameters:
args
- A ScriptID, then the args for the script
-
setOnKeyListener
void setOnKeyListener(Object... args)
Sets a script to be ran on key input- Parameters:
args
- A ScriptID, then the args for the script
-
setOnMouseOverListener
void setOnMouseOverListener(Object... args)
Sets a script to be ran when the mouse enters the widget bounds- Parameters:
args
- A ScriptID, then the args for the script
-
setOnMouseRepeatListener
void setOnMouseRepeatListener(Object... args)
Sets a script to be ran every client tick when the mouse is in the widget bounds- Parameters:
args
- A ScriptID, then the args for the script
-
setOnMouseLeaveListener
void setOnMouseLeaveListener(Object... args)
Sets a script to be ran when the mouse leaves the widget bounds- Parameters:
args
- A ScriptID, then the args for the script
-
setOnTimerListener
void setOnTimerListener(Object... args)
Sets a script to be ran every client tick- Parameters:
args
- A ScriptID, then the args for the script
-
setOnTargetEnterListener
void setOnTargetEnterListener(Object... args)
Sets a script to be ran when the target mode has been activated for this widget- Parameters:
args
- A ScriptID, then the args for the script
-
setOnTargetLeaveListener
void setOnTargetLeaveListener(Object... args)
Sets a script to be ran when the target mode has been deactivated for this widget- Parameters:
args
- A ScriptID, then the args for the script
-
hasListener
boolean hasListener()
If this widget has any listeners on it
-
setHasListener
Widget setHasListener(boolean hasListener)
Sets if the widget has any listeners. This should be called whenever a setXListener function is called
-
isIf3
boolean isIf3()
This is true if the widget is from an if3 interface, or is dynamically created
-
revalidate
void revalidate()
Recomputes this widget's x/y/w/h, excluding scroll
-
revalidateScroll
void revalidateScroll()
Recomputes this widget's group's x/y/w/h including scroll
-
getOnOpListener
Object[] getOnOpListener()
Gets the script and arguments to be ran when a menu action is clicked.- Returns:
-
getOnKeyListener
Object[] getOnKeyListener()
Gets the script and arguments to be ran when a key is pressed.- Returns:
-
getOnLoadListener
Object[] getOnLoadListener()
Gets the script and arguments to be ran when a interface is loaded.- Returns:
-
getOnInvTransmitListener
Object[] getOnInvTransmitListener()
Gets the script and arguments to be ran when one of the listened for inventories changes.- Returns:
-
getFontId
int getFontId()
Returns the archive id of the font used- See Also:
FontID
-
getBorderType
int getBorderType()
Returns the border type of item/sprite on the widget 0 - No border 1 - 1px black border 2 - 1px black under 1px white border (selected item)
-
setBorderType
void setBorderType(int thickness)
- See Also:
getBorderType()
-
getTextShadowed
boolean getTextShadowed()
Returns if text is shadowed
-
setTextShadowed
Widget setTextShadowed(boolean shadowed)
Sets if text should be shadowed
-
getDragDeadZone
int getDragDeadZone()
Returns the widget drag dead zone
-
setDragDeadZone
void setDragDeadZone(int deadZone)
Sets the widget drag dead zone
-
getDragDeadTime
int getDragDeadTime()
Returns the widget drag dead time
-
setDragDeadTime
void setDragDeadTime(int deadTime)
Sets the widget drag dead time
-
getItemQuantityMode
int getItemQuantityMode()
Returns widgetItemQuantityMode
.
-
setItemQuantityMode
Widget setItemQuantityMode(int itemQuantityMode)
Sets the widgetItemQuantityMode
-
getXPositionMode
int getXPositionMode()
Gets the mode that the X position is calculated from the original X position- See Also:
WidgetPositionMode
-
setXPositionMode
Widget setXPositionMode(int xpm)
Sets the mode that the X position is calculated from the original X position.revalidate()
must be called for new values to take effect.- See Also:
WidgetPositionMode
-
getYPositionMode
int getYPositionMode()
Gets the mode that the Y position is calculated from the original Y position- See Also:
WidgetPositionMode
-
setYPositionMode
Widget setYPositionMode(int ypm)
Sets the mode that the Y position is calculated from the original Y position.revalidate()
must be called for new values to take effect.- See Also:
WidgetPositionMode
-
getLineHeight
int getLineHeight()
Get the line height for this widget.- Returns:
-
setLineHeight
Widget setLineHeight(int lineHeight)
Set the line height for this widget. If set to 0, the line height is taken from the font instead.- Parameters:
lineHeight
-
-
getXTextAlignment
int getXTextAlignment()
Gets the X axis text position mode- See Also:
WidgetTextAlignment
-
setXTextAlignment
Widget setXTextAlignment(int xta)
Sets the X axis text position mode- See Also:
WidgetTextAlignment
-
getYTextAlignment
int getYTextAlignment()
Gets the Y axis text position mode- See Also:
WidgetTextAlignment
-
setYTextAlignment
Widget setYTextAlignment(int yta)
Sets the Y axis text position mode- See Also:
WidgetTextAlignment
-
getWidthMode
int getWidthMode()
Gets the mode controlling widget width- See Also:
WidgetSizeMode
-
setWidthMode
Widget setWidthMode(int widthMode)
Sets the mode controlling widget width.revalidate()
must be called for new values to take effect.- See Also:
WidgetSizeMode
-
getHeightMode
int getHeightMode()
Gets the mode controlling widget width- See Also:
WidgetSizeMode
-
setHeightMode
Widget setHeightMode(int heightMode)
Sets the mode controlling widget width.revalidate()
must be called for new values to take effect.- See Also:
WidgetSizeMode
-
getFont
FontTypeFace getFont()
Gets the font that this widget uses
-
isFilled
boolean isFilled()
Gets if the rectangle is filled or just stroked
-
setFilled
Widget setFilled(boolean filled)
Sets if the rectangle is filled or just stroked
-
getTargetVerb
String getTargetVerb()
Verb for spell targets
-
setTargetVerb
void setTargetVerb(String targetVerb)
Verb for spell targets
-
getNoClickThrough
boolean getNoClickThrough()
Can widgets under this widgets be clicked in this widgets bounding box
-
setNoClickThrough
void setNoClickThrough(boolean noClickThrough)
Can widgets under this widgets be clicked in this widgets bounding box
-
getNoScrollThrough
boolean getNoScrollThrough()
Can widgets under this widgets be scrolled in this widgets bounding box
-
setNoScrollThrough
void setNoScrollThrough(boolean noScrollThrough)
Can widgets under this widgets be scrolled in this widgets bounding box
-
getVarTransmitTrigger
int[] getVarTransmitTrigger()
VarPlayer
s that triggers this widgets varTransmitListener
-
setVarTransmitTrigger
void setVarTransmitTrigger(int... trigger)
VarPlayer
s that triggers this widgets varTransmitListener
-
setOnClickListener
void setOnClickListener(Object... args)
Sets a script to be ran the first client tick the mouse is held ontop of this widget- Parameters:
args
- A ScriptID, then the args for the script
-
setOnHoldListener
void setOnHoldListener(Object... args)
Sets a script to be ran the every client tick the mouse is held ontop of this widget, except the first client tick.- Parameters:
args
- A ScriptID, then the args for the script
-
setOnReleaseListener
void setOnReleaseListener(Object... args)
Sets a script to be ran the first client tick the mouse is not held ontop of this widget- Parameters:
args
- A ScriptID, then the args for the script
-
setOnDragCompleteListener
void setOnDragCompleteListener(Object... args)
Sets a script to be ran when a drag operation is finished on this widget- Parameters:
args
- A ScriptID, then the args for the script
-
setOnDragListener
void setOnDragListener(Object... args)
Sets a script to be ran when this widget moves due to a drag- Parameters:
args
- A ScriptID, then the args for the script
-
setOnScrollWheelListener
void setOnScrollWheelListener(Object... args)
Sets a script to be ran when the mouse is scrolled when on the widget- Parameters:
args
- A ScriptID, then the args for the script
-
getDragParent
Widget getDragParent()
Container this can be dragged in
-
getOnVarTransmitListener
Object[] getOnVarTransmitListener()
Gets the script and arguments to be ran when one of the listened for vars changes.- Returns:
-
setOnVarTransmitListener
void setOnVarTransmitListener(Object... args)
Sets a script to be ran when a varplayer changes- Parameters:
args
- A ScriptID, then the args for the script
-
-