Class WorldMapService
- java.lang.Object
-
- com.kraken.api.service.map.WorldMapService
-
public class WorldMapService extends java.lang.Object
-
-
Constructor Summary
Constructors Constructor Description WorldMapService()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanisWorldMapOpen()Determines whether the world map interface is currently open and visible.net.runelite.api.coords.WorldPointmapClickToWorldPoint(int clickX, int clickY)Converts the screen-space click coordinates on the world map interface to a correspondingWorldPointin the game world.net.runelite.api.coords.WorldPointmapClickToWorldPoint(int clickX, int clickY, int plane)Maps the click coordinates on the world map to aWorldPointin the game world, with a specified plane (altitude).java.lang.IntegerworldPointToMapPointX(net.runelite.api.coords.WorldPoint worldPoint)Converts aWorldPointto its corresponding screen X coordinate on the world map.java.lang.IntegerworldPointToMapPointY(net.runelite.api.coords.WorldPoint worldPoint)Converts aWorldPointin the game world to its corresponding screen Y coordinate on the world map interface.
-
-
-
Method Detail
-
mapClickToWorldPoint
public net.runelite.api.coords.WorldPoint mapClickToWorldPoint(int clickX, int clickY)Converts the screen-space click coordinates on the world map interface to a correspondingWorldPointin the game world.This method takes the x and y coordinates of a mouse click and determines the equivalent world map coordinates by accounting for the map's zoom level, current position, and bounds. If the click is outside the map's bounds or the world map is unavailable, the method returns
null.- Parameters:
clickX- the x-coordinate of the mouse click on the world map interfaceclickY- the y-coordinate of the mouse click on the world map interface- Returns:
- the
WorldPointcorresponding to the clicked coordinates, ornullif the conversion cannot be performed
-
mapClickToWorldPoint
public net.runelite.api.coords.WorldPoint mapClickToWorldPoint(int clickX, int clickY, int plane)Maps the click coordinates on the world map to aWorldPointin the game world, with a specified plane (altitude).This method converts user interaction on the world map interface (e.g., clicking) into corresponding game world coordinates while ensuring the plane value is constrained between valid ranges (0 to 3). If the conversion fails (e.g., invalid input or map state),
nullis returned.- Parameters:
clickX- the x-coordinate of the mouse click on the world map interfaceclickY- the y-coordinate of the mouse click on the world map interfaceplane- the desired plane (altitude) for the resultingWorldPoint; values outside the range [0, 3] will be clamped- Returns:
- the
WorldPointcorresponding to the click coordinates and specified plane, ornullif the conversion fails
-
worldPointToMapPointX
public java.lang.Integer worldPointToMapPointX(net.runelite.api.coords.WorldPoint worldPoint)
Converts aWorldPointto its corresponding screen X coordinate on the world map.This method calculates the X coordinate of a given
WorldPointrelative to the world map interface, considering the map's zoom level, current position, and bounds. If the world map or any related components are unavailable, the method returnsnull.- Parameters:
worldPoint- theWorldPointto convert; must not benull- Returns:
- the screen X coordinate on the world map, or
nullif the conversion cannot be performed
-
worldPointToMapPointY
public java.lang.Integer worldPointToMapPointY(net.runelite.api.coords.WorldPoint worldPoint)
Converts aWorldPointin the game world to its corresponding screen Y coordinate on the world map interface.This method calculates the screen Y position of the given
WorldPointin relation to the world map widget, taking into account the map's zoom level, current position, and widget bounds. If theWorldPointor world map components are unavailable, the method returnsnull.- Parameters:
worldPoint- theWorldPointto convert; must not benull. Ifnull, the method will returnnull.- Returns:
- the screen Y coordinate on the world map corresponding to the given
WorldPoint, ornullif the conversion cannot be performed due to invalid input or unavailable map state.
-
isWorldMapOpen
public boolean isWorldMapOpen()
Determines whether the world map interface is currently open and visible.This method checks the state of the world map widget within the game client to assess its visibility. If the widget corresponding to the world map is not available or is hidden, it returns
false, indicating that the world map is closed or inaccessible. Otherwise, it returnstrue.- Returns:
trueif the world map interface is open and visible;falseotherwise. This includes cases where the widget is absent or hidden.
-
-