Package net.runelite.api.widgets
Interface Widget
-
public interface WidgetRepresents 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 voidclearActions()Clear the menu options on a widget.booleancontains(Point point)Checks if the passed canvas points is inside of this widget'sboundsWidgetcreateChild(int type)Creates a dynamic widget child at the end of the children listWidgetcreateChild(int index, int type)Creates a dynamic widget childvoiddeleteAllChildren()Removes all of this widget's dynamic childrenString[]getActions()Gets the menu options available on the widget as a sparse array.intgetAnimationId()Gets the sequence ID used to animate the model in the widgetintgetBorderType()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)RectanglegetBounds()Gets the area where the widget is drawn on the canvas.PointgetCanvasLocation()Gets the location the widget is being drawn on the canvas.WidgetgetChild(int index)Gets a dynamic child by indexWidget[]getChildren()Gets the dynamic children of this widget in a sparse arrayintgetClickMask()Gets the current click configuration of the widget.intgetContentType()Gets the type of content displayed by the widget.intgetDragDeadTime()Returns the widget drag dead timeintgetDragDeadZone()Returns the widget drag dead zoneWidgetgetDragParent()Container this can be dragged inWidget[]getDynamicChildren()Gets all dynamic children.FontTypeFacegetFont()Gets the font that this widget usesintgetFontId()Returns the archive id of the font usedintgetHeight()Gets the height of the widget.intgetHeightMode()Gets the mode controlling widget widthintgetId()Gets the widgets ID.intgetIndex()The index of this widget in it's parent's children arrayintgetItemId()Gets the item ID displayed by the widget.intgetItemQuantity()Gets the quantity of the item displayed by the widget.intgetItemQuantityMode()Returns widgetItemQuantityMode.intgetLineHeight()Get the line height for this widget.intgetModelId()Gets the Model/NPC/Item ID displayed in the widget.intgetModelType()Gets the model type of the widget.intgetModelZoom()Gets the amount zoomed in on the model displayed in the widget.StringgetName()Gets the name "op base" of the widget.Widget[]getNestedChildren()Gets all nested children.booleangetNoClickThrough()Can widgets under this widgets be clicked in this widgets bounding boxbooleangetNoScrollThrough()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.intgetOpacity()Gets the transparency of the rectangleintgetOriginalHeight()Gets the height coordinate of this widget before being adjusted bygetHeightMode()intgetOriginalWidth()Gets the width coordinate of this widget before being adjusted bygetWidthMode()intgetOriginalX()Gets the X coordinate of this widget before being adjusted bygetXPositionMode()}.intgetOriginalY()Gets the Y coordinate of this widget before being adjusted bygetYPositionMode()}WidgetgetParent()Gets the parent widget, if this widget is a child.intgetParentId()Gets the ID of the parent widget.intgetRelativeX()Gets the relative x-axis coordinate to the widgets parent.intgetRelativeY()Gets the relative y-axis coordinate to the widgets parent.@org.jetbrains.annotations.Range(from=0L, to=2047L) intgetRotationX()Gets the x rotation of the model displayed in the widget.@org.jetbrains.annotations.Range(from=0L, to=2047L) intgetRotationY()Gets the y rotation of the model displayed in the widget.@org.jetbrains.annotations.Range(from=0L, to=2047L) intgetRotationZ()Gets the z rotation of the model displayed in the widget.intgetScrollHeight()Gets the size of the widget's viewport in the Y axisintgetScrollWidth()Gets the size of the widget's viewport in the X axisintgetScrollX()Gets the amount of pixels the widget is scrolled in the X axisintgetScrollY()Gets the amount of pixels the widget is scrolled in the Y axisintgetSpriteId()Gets the sprite ID displayed in the widget.booleangetSpriteTiling()Gets if sprites are repeated or stretchedWidget[]getStaticChildren()Gets all static children.intgetTargetPriority()Get the priority that the target verb op is atStringgetTargetVerb()Verb for op targetsStringgetText()Gets the text displayed on this widget.intgetTextColor()Gets the color as an RGB value.booleangetTextShadowed()Returns if text is shadowedintgetType()Gets the type of the widget.int[]getVarTransmitTrigger()VarPlayerIDs that triggers this widgets varTransmitListenerintgetWidth()Gets the width of the widget.intgetWidthMode()Gets the mode controlling widget widthintgetXPositionMode()Gets the mode that the X position is calculated from the original X positionintgetXTextAlignment()Gets the X axis text position modeintgetYPositionMode()Gets the mode that the Y position is calculated from the original Y positionintgetYTextAlignment()Gets the Y axis text position modebooleanhasListener()If this widget has any listeners on itbooleanisFilled()Gets if the rectangle is filled or just strokedbooleanisFlippedHorizontally()Get if this graphic flipped horizontallybooleanisFlippedVertically()Get if this graphic flipped verticallybooleanisHidden()Checks whether this widget or any of its parents are hidden.booleanisIf3()This is true if the widget is from an if3 interface, or is dynamically createdbooleanisSelfHidden()Checks whether this widget is hidden, not taking into account any parent hidden states.voidrevalidate()Recomputes this widget's x/y/w/h, excluding scrollvoidrevalidateScroll()Recomputes this widget's group's x/y/w/h including scrollvoidsetAction(int index, String action)Creates a menu option on the widgetWidgetsetAnimationId(int animationId)Sets the sequence ID used to animate the model in the widgetvoidsetBorderType(int thickness)voidsetChildren(Widget[] children)Sets the dynamic children sparse arrayWidgetsetClickMask(int mask)Sets the click configuration of the widget.WidgetsetContentType(int contentType)Sets the type of content displayed by the widget.voidsetDragDeadTime(int deadTime)Sets the widget drag dead timevoidsetDragDeadZone(int deadZone)Sets the widget drag dead zoneWidgetsetDragParent(Widget dragParent)Container this can be dragged inWidgetsetFilled(boolean filled)Sets if the rectangle is filled or just strokedvoidsetFlippedHorizontally(boolean flip)Set if this graphic is flipped horizontallyvoidsetFlippedVertically(boolean flip)Set if this graphic is flipped verticallyWidgetsetFontId(int id)Sets the archive id of the fontvoidsetForcedPosition(int x, int y)Set a forced position for the widget.WidgetsetHasListener(boolean hasListener)Sets if the widget has any listeners.voidsetHeight(int height)Deprecated.WidgetsetHeightMode(int heightMode)Sets the mode controlling widget width.WidgetsetHidden(boolean hidden)Sets the self-hidden state of this widget.WidgetsetItemId(int itemId)Sets the item ID displayed by the widget.WidgetsetItemQuantity(int quantity)Sets the item quantity displayed by the widget.WidgetsetItemQuantityMode(int itemQuantityMode)Sets the widgetItemQuantityModeWidgetsetLineHeight(int lineHeight)Set the line height for this widget.WidgetsetModelId(int id)Sets the Model/NPC/Item ID displayed in the widget.WidgetsetModelType(int type)Sets the model type of the widget.WidgetsetModelZoom(int modelZoom)Sets the amount zoomed in on the model displayed in the widget.WidgetsetName(String name)Sets the name of the widget.voidsetNoClickThrough(boolean noClickThrough)Can widgets under this widgets be clicked in this widgets bounding boxvoidsetNoScrollThrough(boolean noScrollThrough)Can widgets under this widgets be scrolled in this widgets bounding boxvoidsetOnClickListener(Object... args)Sets a script to be ran the first client tick the mouse is held ontop of this widgetvoidsetOnDialogAbortListener(Object... args)Sets a script to be ran when the dialog is canceledvoidsetOnDragCompleteListener(Object... args)Sets a script to be ran when a drag operation is finished on this widgetvoidsetOnDragListener(Object... args)Sets a script to be ran when this widget moves due to a dragvoidsetOnHoldListener(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.voidsetOnKeyListener(Object... args)Sets a script to be ran on key inputvoidsetOnMouseLeaveListener(Object... args)Sets a script to be ran when the mouse leaves the widget boundsvoidsetOnMouseOverListener(Object... args)Sets a script to be ran when the mouse enters the widget boundsvoidsetOnMouseRepeatListener(Object... args)Sets a script to be ran every client tick when the mouse is in the widget boundsvoidsetOnOpListener(Object... args)Sets a script to be ran when the a menu action is clicked.voidsetOnReleaseListener(Object... args)Sets a script to be ran the first client tick the mouse is not held ontop of this widgetvoidsetOnScrollWheelListener(Object... args)Sets a script to be ran when the mouse is scrolled when on the widgetvoidsetOnTargetEnterListener(Object... args)Sets a script to be ran when the target mode has been activated for this widgetvoidsetOnTargetLeaveListener(Object... args)Sets a script to be ran when the target mode has been deactivated for this widgetvoidsetOnTimerListener(Object... args)Sets a script to be ran every client tickvoidsetOnVarTransmitListener(Object... args)Sets a script to be ran when a varplayer changesWidgetsetOpacity(int transparency)Sets the transparency of the rectangleWidgetsetOriginalHeight(int originalHeight)Sets the height input to theWidgetSizeMode.WidgetsetOriginalWidth(int originalWidth)Sets the width input to theWidgetSizeMode.WidgetsetOriginalX(int originalX)Sets the X input to theWidgetPositionMode.WidgetsetOriginalY(int originalY)Sets the Y input to theWidgetPositionMode.WidgetsetPos(int x, int y)Sets the X/Y coordinatesWidgetsetPos(int x, int y, int xMode, int yMode)voidsetRelativeX(int x)Deprecated.voidsetRelativeY(int y)Deprecated.WidgetsetRotationX(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelX)Sets the x rotation of the model displayed in the widget.WidgetsetRotationY(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelY)Sets the y rotation of the model displayed in the widget.WidgetsetRotationZ(@org.jetbrains.annotations.Range(from=0L, to=2047L) int modelZ)Sets the z rotation of the model displayed in the widget.WidgetsetScrollHeight(int height)Sets the size of the widget's viewport in the Y axisWidgetsetScrollWidth(int width)Sets the size of the widget's viewport in the X axisWidgetsetScrollX(int scrollX)Sets the amount of pixels the widget is scrolled in the X axisWidgetsetScrollY(int scrollY)sets the amount of pixels the widget is scrolled in the Y axisWidgetsetSize(int width, int height)WidgetsetSize(int width, int height, int widthMode, int heightMode)WidgetsetSpriteId(int spriteId)Sets the sprite ID displayed in the widget.WidgetsetSpriteTiling(boolean tiling)Sets if sprites are repeated or stretchedvoidsetTargetPriority(int priority)Set the priority that the target verb op is atvoidsetTargetVerb(String targetVerb)Verb for op targetsWidgetsetText(String text)Sets the text displayed on this widget.WidgetsetTextColor(int textColor)Sets the RGB color of the displayed text or rectangle.WidgetsetTextShadowed(boolean shadowed)Sets if text should be shadowedvoidsetType(int type)Sets the type of the widget.voidsetVarTransmitTrigger(int... trigger)VarPlayerIDs that triggers this widgets varTransmitListenervoidsetWidth(int width)Deprecated.WidgetsetWidthMode(int widthMode)Sets the mode controlling widget width.WidgetsetXPositionMode(int xpm)Sets the mode that the X position is calculated from the original X position.WidgetsetXTextAlignment(int xta)Sets the X axis text position modeWidgetsetYPositionMode(int ypm)Sets the mode that the Y position is calculated from the original Y position.WidgetsetYTextAlignment(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
WidgetItems, 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- theWidgetTypeof the widget
-
createChild
Widget createChild(int type)
Creates a dynamic widget child at the end of the children list- Parameters:
type- theWidgetTypeof 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()
-
isFlippedVertically
boolean isFlippedVertically()
Get if this graphic flipped vertically- Returns:
-
setFlippedVertically
void setFlippedVertically(boolean flip)
Set if this graphic is flipped vertically- Parameters:
flip-
-
isFlippedHorizontally
boolean isFlippedHorizontally()
Get if this graphic flipped horizontally- Returns:
-
setFlippedHorizontally
void setFlippedHorizontally(boolean flip)
Set if this graphic is flipped horizontally- Parameters:
flip-
-
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 op targets
-
setTargetVerb
void setTargetVerb(String targetVerb)
Verb for op targets
-
getTargetPriority
int getTargetPriority()
Get the priority that the target verb op is at
-
setTargetPriority
void setTargetPriority(int priority)
Set the priority that the target verb op is at- Parameters:
priority- priority, default 4
-
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()
VarPlayerIDs that triggers this widgets varTransmitListener
-
setVarTransmitTrigger
void setVarTransmitTrigger(int... trigger)
VarPlayerIDs 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
-
-