Class GuiUtils


  • public class GuiUtils
    extends java.lang.Object
    • Constructor Summary

      Constructors 
      Constructor Description
      GuiUtils()  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static void center​(com.simsilica.lemur.Panel panel)
      Set the location of the panel to the center (horizontal and vertical) of the screen
      static void clampBoundaries​(com.simsilica.lemur.Panel panel)
      Updates the location of the panel if the panel goes outside the screen boundaries.
      static int getHeight()  
      static int getWidth()  
      static void setMouseCursor​(java.lang.String image)
      Sets a mouse cursor image.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • GuiUtils

        public GuiUtils()
    • Method Detail

      • clampBoundaries

        public static void clampBoundaries​(com.simsilica.lemur.Panel panel)
        Updates the location of the panel if the panel goes outside the screen boundaries. This can be useful if you want to make sure that draggable panels can't be dragged outside the screen.
        Parameters:
        panel - the panel to check
      • center

        public static void center​(com.simsilica.lemur.Panel panel)
        Set the location of the panel to the center (horizontal and vertical) of the screen
        Parameters:
        panel - the panel to center
      • getHeight

        public static int getHeight()
        Returns:
        the height/resolution of the display
      • getWidth

        public static int getWidth()
        Returns:
        the width/resolution of the display
      • setMouseCursor

        public static void setMouseCursor​(java.lang.String image)
        Sets a mouse cursor image. When a null string is given the default system cursor is set.
        Parameters:
        image - path to the cursor in the assets folder, or null for the default system cursor