Package journeymap.api.v2.client.display
Interface IOverlayListener
public interface IOverlayListener
Interface for receiving user events related to an Overlay.
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidonActivate(UIState mapState) Called when the Overlay is actively displayed.default voidonDeactivate(UIState mapState) Called when Overlay is no longer displayed.default 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.default voidonMouseMove(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition) Called when the mouse moves within the bounds of the overlay.default voidonMouseOut(UIState mapState, Point2D.Double mousePosition, net.minecraft.core.BlockPos blockPosition) Called when the mouse first leaves the bounds of the overlay.default 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
default 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
default 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
default 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
default 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
-