Interface Painter

    • Method Detail

      • getBaseWidth

        int getBaseWidth()
        Gets the base width of this painter.
        Returns:
        The base width.
      • getBaseHeight

        int getBaseHeight()
        Gets the base height of this painter.
        Returns:
        The base height.
      • setOptions

        void setOptions​(Options opt)
        Sets the options for this Painter.
        Parameters:
        opt - The options.
      • setArea

        void setArea​(Rectangle area)
        Sets the display area for this Painter. All graphic operations are restricted to this area.
        Parameters:
        area - The paint area.
      • getArea

        Rectangle getArea()
        Gets the display area for this Painter.
        Returns:
        The paint area.
      • paint

        void paint​(Graphics g,
                   GameState state)
        Paints on the screen.
        Parameters:
        g - The graphics to paint on.
        state - The game state.
      • getXFactor

        double getXFactor()
        Returns an painter specific x scaling factor.
        Returns:
        The x scaling factor.
      • getYFactor

        double getYFactor()
        Returns a painter specific y scaling factor.
        Returns:
        The y scaling factor.
      • onStartGame

        void onStartGame​(GameState state)
        Called if new game is started.
        Parameters:
        state - The game state.
      • isActive

        boolean isActive()
        Checks, if this painter is currently active and wants to handle events.
        Returns:
        true, if the painter is currently active.
      • setState

        void setState​(GameState state)
        Sets the game state. The game state should be used for all painting operations due to asynchronous changes in the game during updates.
        Parameters:
        state - The state.