Package journeymap.api.v2.client.display
Interface IOverlayListener
public interface IOverlayListener
Interface for receiving user events related to an Overlay.
-
Method Summary
Modifier and TypeMethodDescriptionvoidonActivate(UIState mapState) Called when the Overlay is actively displayed.voidonDeactivate(UIState mapState) Called when Overlay is no longer displayed.booleanonMouseClick(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition, int button, boolean doubleClick) Called when the mouse is clicked within the bounds of the overlay.voidonMouseMove(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition) Called when the mouse moves within the bounds of the overlay.voidonMouseOut(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition) Called when the mouse first leaves the bounds of the overlay.voidonOverlayMenuPopup(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition, ModPopupMenu modPopupMenu) Called when the popup menu is displayed on an overlay.
-
Method Details
-
onActivate
Called when the Overlay is actively displayed.- Parameters:
mapState- current UIState of the UI where the overlay is active.
-
onDeactivate
Called when Overlay is no longer displayed.- Parameters:
mapState- current UIState of the UI where the overlay is inactive.
-
onMouseMove
void onMouseMove(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition) Called when the mouse moves within the bounds of the overlay.- Parameters:
mapState- current UIState of the UI where the overlay is active.mousePosition- screen coordinates of the mouseblockPosition- the block position under the mouse
-
onMouseOut
void onMouseOut(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition) Called when the mouse first leaves the bounds of the overlay.- Parameters:
mapState- current UIState of the UI where the overlay is active.mousePosition- screen coordinates of the mouseblockPosition- the block position under the mouse
-
onMouseClick
boolean onMouseClick(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition, int button, boolean doubleClick) Called when the mouse is clicked within the bounds of the overlay.- Parameters:
mapState- current UIState of the UI where the overlay is active.mousePosition- screen coordinates of the mouseblockPosition- the block position under the mousebutton- the mouse button clickeddoubleClick- true if the mouse button was double-clicked- Returns:
- true if click event can bubble up to other overlays which occupy the same area.
-
onOverlayMenuPopup
void onOverlayMenuPopup(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition, ModPopupMenu modPopupMenu) Called when the popup menu is displayed on an overlay.- Parameters:
mapState- current UIState of the UI where the overlay is active.mousePosition- screen coordinates of the mouseblockPosition- the block position under the mousemodPopupMenu- the modMenuPopup
-