Package net.openosrs.api.input.target
Class ShapeDestination
- java.lang.Object
-
- net.openosrs.api.input.target.Destination
-
- net.openosrs.api.input.target.ShapeDestination
-
public class ShapeDestination extends Destination
A destination backed by a shape that is re-read on every query.The supplier indirection is what makes target tracking work: the planner asks for the shape again part-way through a movement, so a widget that scrolls or an outline that shifts is followed rather than clicked where it used to be.
-
-
Constructor Summary
Constructors Constructor Description ShapeDestination(java.util.function.Supplier<java.awt.Shape> supplier, java.lang.String label)ShapeDestination(java.util.function.Supplier<java.awt.Shape> supplier, java.lang.String label, boolean fixedOnScreen)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancameraCanHelp()Interface furniture lives at fixed screen coordinates.java.lang.Stringdescribe()A short label for logging and the overlay.booleanneedsCamera()Whether reaching this destination needs the camera moved first.java.awt.Shapeshape()The raw clickable outline in canvas pixels, ornullwhen the target has no projection at all.-
Methods inherited from class net.openosrs.api.input.target.Destination
area, bounds, centre, contains, focusPoint, getViewport, isCurrent, isVisible, needsScroll, scrollContainer, scrollDirection, suitablePoint, toString, visibleShape, withValidity, withViewport
-
-
-
-
Method Detail
-
shape
public java.awt.Shape shape()
Description copied from class:DestinationThe raw clickable outline in canvas pixels, ornullwhen the target has no projection at all.This is unclipped on purpose. The client projects actors and objects that are behind or beside the camera to coordinates far outside the canvas rather than returning null, so a non-null shape here is not a claim that anything is on screen. Use
Destination.visibleShape()for that.- Specified by:
shapein classDestination
-
describe
public java.lang.String describe()
Description copied from class:DestinationA short label for logging and the overlay.- Specified by:
describein classDestination
-
cameraCanHelp
public boolean cameraCanHelp()
Interface furniture lives at fixed screen coordinates. Rotating the camera will never bring a hidden inventory slot into view, so say so rather than letting the backend waste a rotation discovering it.- Overrides:
cameraCanHelpin classDestination
-
needsCamera
public boolean needsCamera()
Description copied from class:DestinationWhether reaching this destination needs the camera moved first. Targets that are simply off screen answertrue; fixed screen furniture such as an inventory slot never does.- Overrides:
needsCamerain classDestination
-
-