Interface HudSurface

All Known Subinterfaces:
HudSession

public interface HudSurface
A client-thread HUD contribution. The host renders back-to-front and dispatches pointer input front-to-back. Implementations must balance their graphics state and must not perform blocking I/O. On 1.21.1 the host maps each contribution's local Z range [-10000,10000] into its own non-overlapping depth interval. Use local depth only inside this range; do not change the global GUI projection. On 26.2 the host supplies the equivalent order with GUI strata.
  • Method Summary

    Modifier and Type
    Method
    Description
    default void
    Cancel transient input when the mouse screen closes; do not destroy displayed content.
    default boolean
    drag(double x, double y, int button, HudMode mode)
    Only the captured surface receives drag events.
    default boolean
    keyPressed(int key, int scan, int modifiers, int mouseX, int mouseY, HudMode mode)
    Optional keys for the surface under the pointer, such as layout density changes.
    default boolean
    press(double x, double y, int button, HudMode mode)
    Return true to own this button until release or cancellation.
    default void
    release(double x, double y, int button, HudMode mode)
    The host has released capture before invoking this callback.
    void
    render(HudCanvas graphics, int mouseX, int mouseY, HudMode mode)
    Draw this surface.
    default boolean
    scroll(double x, double y, double amount, HudMode mode)
    Return true only when this visible surface handled the scroll.
  • Method Details

    • render

      void render(HudCanvas graphics, int mouseX, int mouseY, HudMode mode)
      Draw this surface. Mouse coordinates are -1 in passive mode. MOUSE preserves the normal appearance; LAYOUT exposes persistent placement settings, not ordinary content actions.
    • press

      default boolean press(double x, double y, int button, HudMode mode)
      Return true to own this button until release or cancellation. May open another screen.
    • drag

      default boolean drag(double x, double y, int button, HudMode mode)
      Only the captured surface receives drag events.
    • release

      default void release(double x, double y, int button, HudMode mode)
      The host has released capture before invoking this callback.
    • scroll

      default boolean scroll(double x, double y, double amount, HudMode mode)
      Return true only when this visible surface handled the scroll.
    • keyPressed

      default boolean keyPressed(int key, int scan, int modifiers, int mouseX, int mouseY, HudMode mode)
      Optional keys for the surface under the pointer, such as layout density changes.
    • cancelInteraction

      default void cancelInteraction()
      Cancel transient input when the mouse screen closes; do not destroy displayed content. Must be idempotent. If press closes a screen reentrantly, cancellation may be repeated after that callback returns, and may arrive after WorldSession.close on the original session.