Package HAL.Gui

Class GridWindow

  • All Implemented Interfaces:
    Grid2D, GuiComp

    public class GridWindow
    extends UIGrid
    The GridWindow is a stand-alone window with a UIGrid embedded, it allows drawwing to it by setting pixels
    • Constructor Detail

      • GridWindow

        public GridWindow​(java.lang.String title,
                          int xDim,
                          int yDim,
                          int scaleFactor,
                          boolean killOnClose,
                          GuiCloseAction CloseAction,
                          boolean active)
        Creates a new GridWindow
        Parameters:
        title - the title that will appear at the top of the window (default "")
        xDim - the length in UIGrid squares
        yDim - the height in UIGrid squares
        scaleFactor - the conversion factor between a pixel width/height and the length/height of a UIGrid square (default 1)
        killOnClose - whether the program should exit when the window is closed (default true)
        CloseAction - function that runs when the window is closed (default null)
        active - if set to false, the GridWindow will not actually render and its methods will be skipped (default true)
      • GridWindow

        public GridWindow​(int xDim,
                          int yDim)
        the below constructors are variants of the above constructor with default values for some of the arguments
      • GridWindow

        public GridWindow​(int xDim,
                          int yDim,
                          boolean active)
      • GridWindow

        public GridWindow​(int xDim,
                          int yDim,
                          int scaleFactor)
      • GridWindow

        public GridWindow​(int xDim,
                          int yDim,
                          int scaleFactor,
                          boolean active)
      • GridWindow

        public GridWindow​(int xDim,
                          int yDim,
                          int scaleFactor,
                          boolean killOnClose,
                          GuiCloseAction CloseAction)
      • GridWindow

        public GridWindow​(int xDim,
                          int yDim,
                          int scaleFactor,
                          boolean killOnClose,
                          GuiCloseAction CloseAction,
                          boolean active)
      • GridWindow

        public GridWindow​(java.lang.String title,
                          int xDim,
                          int yDim)
      • GridWindow

        public GridWindow​(java.lang.String title,
                          int xDim,
                          int yDim,
                          boolean active)
      • GridWindow

        public GridWindow​(java.lang.String title,
                          int xDim,
                          int yDim,
                          int scaleFactor)
      • GridWindow

        public GridWindow​(java.lang.String title,
                          int xDim,
                          int yDim,
                          int scaleFactor,
                          boolean active)
      • GridWindow

        public GridWindow​(java.lang.String title,
                          int xDim,
                          int yDim,
                          int scaleFactor,
                          boolean killOnClose,
                          GuiCloseAction CloseAction)
    • Method Detail

      • IsKeyDown

        public boolean IsKeyDown​(char c)
        returns whether the given key is currently pressed
      • IsKeyDown

        public boolean IsKeyDown​(int keyCode)
        returns whether the given key is currently pressed
      • AddKeyResponses

        public void AddKeyResponses​(KeyResponse OnKeyDown,
                                    KeyResponse OnKeyUp)
        takes 2 key response functions that will be called whenever a key is pressed or released
      • Close

        public void Close()
        disposes of the GridWindow.
      • IsClosed

        public boolean IsClosed()