Class NotchInset

java.lang.Object
me.hackware.api.gui.NotchInset

public final class NotchInset extends Object
macOS notch (camera-housing) safe-area detection for the ClickGUI top chrome.

On notched MacBooks the display reserves a taller menu-bar strip for the camera housing. In fullscreen the game framebuffer spans the whole panel, so the notch overlaps the top of the screen and hides the centre of the tab bar. top(Minecraft) returns the vertical inset (in GUI-space pixels) the tab bar and content should be pushed down by so nothing sits under the notch.

Non-macOS, non-notched and windowed setups all return 0 — windowed content already lays out below the system menu bar.

  • Method Summary

    Modifier and Type
    Method
    Description
    static int
    top(net.minecraft.client.Minecraft mc)
    Top inset, in GUI-space pixels (the same space as screen.width / mouse coords), that the ClickGUI chrome should leave clear for the macOS notch.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Method Details

    • top

      public static int top(net.minecraft.client.Minecraft mc)
      Top inset, in GUI-space pixels (the same space as screen.width / mouse coords), that the ClickGUI chrome should leave clear for the macOS notch. Returns 0 when there is nothing to avoid.