Class InteractablePolygon
- java.lang.Object
-
- com.runemate.game.api.hybrid.local.hud.InteractablePolygon
-
- All Implemented Interfaces:
Interactable
,Renderable
,java.awt.Shape
public class InteractablePolygon extends java.lang.Object implements java.awt.Shape, Interactable, Renderable
-
-
Constructor Summary
Constructors Constructor Description InteractablePolygon(java.awt.Polygon polygon)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
click()
Clicks this entity in an interactable pointboolean
contains(double x, double y)
boolean
contains(double x, double y, double w, double h)
boolean
contains(java.awt.geom.Point2D p)
boolean
contains(java.awt.geom.Rectangle2D rectangle)
boolean
contains(java.awt.Point point)
Checks if the projected bounds of this entity contains the Point provided.java.awt.Rectangle
getBounds()
java.awt.geom.Rectangle2D
getBounds2D()
InteractablePoint
getInteractionPoint(java.awt.Point origin)
Gets a point within the entity that can be interacted with.java.awt.geom.PathIterator
getPathIterator(java.awt.geom.AffineTransform at)
java.awt.geom.PathIterator
getPathIterator(java.awt.geom.AffineTransform at, double flatness)
double
getVisibility()
Returns a rough estimate of how visible this entity is as a percent (0 to 100)boolean
hasDynamicBounds()
boolean
interact(java.lang.String action)
boolean
interact(java.lang.String action, java.util.regex.Pattern target)
boolean
interact(java.util.regex.Pattern action)
boolean
interact(java.util.regex.Pattern action, java.lang.String target)
boolean
interact(java.util.regex.Pattern action, java.util.regex.Pattern target)
Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu itemboolean
intersects(double x, double y, double w, double h)
boolean
intersects(java.awt.geom.Rectangle2D r)
boolean
isVisible()
Whether the entity is visiblevoid
render(java.awt.Graphics2D g2d)
Renders this entity onto the givenGraphics2D
, use is discouragedvoid
render(java.awt.Graphics2D g2d, boolean fill)
void
render(javafx.scene.canvas.GraphicsContext gc)
Renders this entity onto the givenGraphicsContext
void
render(javafx.scene.canvas.GraphicsContext gc, boolean fill)
java.lang.String
toString()
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.runemate.game.api.hybrid.entities.details.Interactable
getInteractionPoint, hover, interact, isHovered
-
-
-
-
Method Detail
-
isVisible
public boolean isVisible()
Description copied from interface:Interactable
Whether the entity is visible- Specified by:
isVisible
in interfaceInteractable
- Returns:
- true if visible, and false if not visible
-
getVisibility
public double getVisibility()
Description copied from interface:Interactable
Returns a rough estimate of how visible this entity is as a percent (0 to 100)- Specified by:
getVisibility
in interfaceInteractable
-
hasDynamicBounds
public boolean hasDynamicBounds()
- Specified by:
hasDynamicBounds
in interfaceInteractable
-
getInteractionPoint
public InteractablePoint getInteractionPoint(java.awt.Point origin)
Description copied from interface:Interactable
Gets a point within the entity that can be interacted with. Takes into account the direction of movement from the origin point.- Specified by:
getInteractionPoint
in interfaceInteractable
-
contains
public boolean contains(java.awt.Point point)
Description copied from interface:Interactable
Checks if the projected bounds of this entity contains the Point provided.- Specified by:
contains
in interfaceInteractable
- Returns:
-
contains
public boolean contains(java.awt.geom.Rectangle2D rectangle)
- Specified by:
contains
in interfacejava.awt.Shape
-
click
public boolean click()
Description copied from interface:Interactable
Clicks this entity in an interactable point- Specified by:
click
in interfaceInteractable
- Returns:
- true if successfully clicked
-
interact
public final boolean interact(java.lang.String action)
- Specified by:
interact
in interfaceInteractable
-
interact
public boolean interact(java.util.regex.Pattern action)
- Specified by:
interact
in interfaceInteractable
-
interact
public final boolean interact(java.util.regex.Pattern action, java.util.regex.Pattern target)
Description copied from interface:Interactable
Attempts to match action and target using Matcher.find() and then interacts with the appropriate menu item- Specified by:
interact
in interfaceInteractable
- Parameters:
action
- The pattern to match the action with, if null it's ignoredtarget
- The pattern to match the target with, if null it's ignored
-
interact
public boolean interact(java.util.regex.Pattern action, java.lang.String target)
- Specified by:
interact
in interfaceInteractable
-
interact
public boolean interact(java.lang.String action, java.util.regex.Pattern target)
- Specified by:
interact
in interfaceInteractable
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
getBounds
public java.awt.Rectangle getBounds()
- Specified by:
getBounds
in interfacejava.awt.Shape
-
getBounds2D
public java.awt.geom.Rectangle2D getBounds2D()
- Specified by:
getBounds2D
in interfacejava.awt.Shape
-
contains
public boolean contains(double x, double y)
- Specified by:
contains
in interfacejava.awt.Shape
-
contains
public boolean contains(java.awt.geom.Point2D p)
- Specified by:
contains
in interfacejava.awt.Shape
-
intersects
public boolean intersects(double x, double y, double w, double h)
- Specified by:
intersects
in interfacejava.awt.Shape
-
intersects
public boolean intersects(java.awt.geom.Rectangle2D r)
- Specified by:
intersects
in interfacejava.awt.Shape
-
contains
public boolean contains(double x, double y, double w, double h)
- Specified by:
contains
in interfacejava.awt.Shape
-
getPathIterator
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at)
- Specified by:
getPathIterator
in interfacejava.awt.Shape
-
getPathIterator
public java.awt.geom.PathIterator getPathIterator(java.awt.geom.AffineTransform at, double flatness)
- Specified by:
getPathIterator
in interfacejava.awt.Shape
-
render
public void render(java.awt.Graphics2D g2d)
Description copied from interface:Renderable
Renders this entity onto the givenGraphics2D
, use is discouraged- Specified by:
render
in interfaceRenderable
-
render
public void render(java.awt.Graphics2D g2d, boolean fill)
-
render
public void render(javafx.scene.canvas.GraphicsContext gc)
Description copied from interface:Renderable
Renders this entity onto the givenGraphicsContext
- Specified by:
render
in interfaceRenderable
-
render
public void render(javafx.scene.canvas.GraphicsContext gc, boolean fill)
-
-