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 boolean
contains(Point point)
Checks if the passed canvas points is inside of this widget'sbounds
Widget
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
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.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.int
getRotationX()
Gets the x rotation of the model displayed in the widget.int
getRotationY()
Gets the y rotation of the model displayed in the widget.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.WidgetItem
getWidgetItem(int index)
Gets a widget item at a specific index.Collection<WidgetItem>
getWidgetItems()
Gets any items that are being displayed in the widget.int
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 widgetvoid
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 arrayvoid
setClickMask(int mask)
Sets the click configuration of the widget.void
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 zonevoid
setDragParent(Widget dragParent)
Container this can be dragged invoid
setFilled(boolean filled)
Sets if the rectangle is filled or just strokedvoid
setFontId(int id)
Sets the archive id of the fontvoid
setHasListener(boolean hasListener)
Sets if the widget has any listeners.void
setHeight(int height)
Deprecated.void
setHeightMode(int heightMode)
Sets the mode controlling widget width.void
setHidden(boolean hidden)
Sets the self-hidden state of this widget.void
setItemId(int itemId)
Sets the item ID displayed by the widget.void
setItemQuantity(int quantity)
Sets the item quantity displayed by the widget.void
setItemQuantityMode(int itemQuantityMode)
Sets the widgetItemQuantityMode
void
setModelId(int id)
Sets the Model/NPC/Item ID displayed in the widget.void
setModelType(int type)
Sets the model type of the widget.void
setModelZoom(int modelZoom)
Sets the amount zoomed in on the model displayed in the widget.void
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
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 changesvoid
setOpacity(int transparency)
Sets the transparency of the rectanglevoid
setOriginalHeight(int originalHeight)
Sets the height input to theWidgetSizeMode
.void
setOriginalWidth(int originalWidth)
Sets the width input to theWidgetSizeMode
.void
setOriginalX(int originalX)
Sets the X input to theWidgetPositionMode
.void
setOriginalY(int originalY)
Sets the Y input to theWidgetPositionMode
.void
setRelativeX(int x)
Deprecated.void
setRelativeY(int y)
Deprecated.void
setRotationX(int modelX)
Sets the x rotation of the model displayed in the widget.void
setRotationY(int modelY)
Sets the y rotation of the model displayed in the widget.void
setRotationZ(int modelZ)
Sets the z rotation of the model displayed in the widget.void
setScrollHeight(int height)
Sets the size of the widget's viewport in the Y axisvoid
setScrollWidth(int width)
Sets the size of the widget's viewport in the X axisvoid
setScrollX(int scrollX)
Sets the amount of pixels the widget is scrolled in the X axisvoid
setScrollY(int scrollY)
sets the amount of pixels the widget is scrolled in the Y axisvoid
setSpriteId(int spriteId)
Sets the sprite ID displayed in the widget.void
setSpriteTiling(boolean tiling)
Sets if sprites are repeated or stretchedvoid
setTargetVerb(String targetVerb)
Verb for spell targetsvoid
setText(String text)
Sets the text displayed on this widget.void
setTextColor(int textColor)
Sets the RGB color of the displayed text or rectangle.void
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.void
setWidthMode(int widthMode)
Sets the mode controlling widget width.void
setXPositionMode(int xpm)
Sets the mode that the X position is calculated from the original X position.void
setXTextAlignment(int xta)
Sets the X axis text position modevoid
setYPositionMode(int ypm)
Sets the mode that the Y position is calculated from the original Y position.void
setYTextAlignment(int yta)
Sets the Y axis text position mode
-
-
-
Method Detail
-
getId
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
void 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
,WidgetConfig
-
setClickMask
void 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
Widget getChild(int index)
Gets a dynamic child by index- Throws:
IndexOutOfBoundsException
- if the index is outside of the child array
-
getChildren
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.
-
getText
String getText()
Gets the text displayed on this widget.- Returns:
- the displayed text
-
setText
void 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
void 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
void 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
-
setName
void setName(String name)
Sets the name of the widget.- Parameters:
name
- the new name
-
getModelId
int getModelId()
Gets the Model/NPC/Item ID displayed in the widget.- See Also:
WidgetModelType
-
setModelId
void 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
void 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
void setAnimationId(int animationId)
Sets the sequence ID used to animate the model in the widget- See Also:
AnimationID
-
getRotationX
int getRotationX()
Gets the x rotation of the model displayed in the widget. 0 = no rotation, 2047 = full rotation
-
setRotationX
void setRotationX(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
int getRotationY()
Gets the y rotation of the model displayed in the widget. 0 = no rotation, 2047 = full rotation
-
setRotationY
void setRotationY(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
int getRotationZ()
Gets the z rotation of the model displayed in the widget. 0 = no rotation, 2047 = full rotation
-
setRotationZ
void setRotationZ(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
void 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
void setSpriteTiling(boolean tiling)
Sets if sprites are repeated or stretched
-
setSpriteId
void 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
void 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
-
getWidgetItems
Collection<WidgetItem> getWidgetItems()
Gets any items that are being displayed in the widget.- Returns:
- any items displayed, or null if there are no items
-
getWidgetItem
WidgetItem getWidgetItem(int index)
Gets a widget item at a specific index.- Parameters:
index
- index of the item- Returns:
- the widget item at index, or null if an item at index does not exist
- Throws:
IndexOutOfBoundsException
- if the index is out of bounds
-
getItemId
int getItemId()
Gets the item ID displayed by the widget.- Returns:
- the item ID
-
setItemId
void 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
void 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
void 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
void 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
void 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
void 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
void 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
void setOriginalY(int originalY)
Sets the Y input to theWidgetPositionMode
.revalidate()
must be called for the new values to take effect.- See Also:
setYPositionMode(int)
-
getOriginalHeight
int getOriginalHeight()
Gets the height coordinate of this widget before being adjusted bygetHeightMode()
-
setOriginalHeight
void 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
void setOriginalWidth(int originalWidth)
Sets the width input to theWidgetSizeMode
.revalidate()
must be called for the new values to take effect.- See Also:
setWidthMode(int)
-
getActions
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
- the type 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
-
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
void 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
-
setFontId
void setFontId(int id)
Sets the archive id of the font- 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
void 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
void 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
void 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
void 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
-
getXTextAlignment
int getXTextAlignment()
Gets the X axis text position mode- See Also:
WidgetTextAlignment
-
setXTextAlignment
void 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
void 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
void 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
void 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
void 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
-
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
-
getDragParent
Widget getDragParent()
Container this can be dragged in
-
setDragParent
void setDragParent(Widget dragParent)
Container this can be dragged in
-
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
-
-