Class PainterTutorial

  • All Implemented Interfaces:
    Painter

    public class PainterTutorial
    extends PainterText
    Tutor screen item that displays the game help.
    • Field Detail

      • offset

        protected int offset
        y-Offset for scrolled painting
      • tutorialText

        public java.lang.String[] tutorialText
        The help texts.
    • Constructor Detail

      • PainterTutorial

        public PainterTutorial()
        Creates a new ItemTutor.
    • Method Detail

      • switchToNextLevel

        public void switchToNextLevel​(GameState state)
        Switches to the next levels help texts.
      • update

        public void update​(UpdateInfo ui)
        Updates the game info to display.
        Parameters:
        ui - The new state.
      • setArea

        public void setArea​(Rectangle area)
        Sets the size for this Painter. All graphic operations should be restricted to this area.
        Specified by:
        setArea in interface Painter
        Overrides:
        setArea in class PainterBase
        Parameters:
        area - The area.
      • paint

        public void paint​(Graphics g,
                          GameState state)
        Paints the text to the screen.
        Specified by:
        paint in interface Painter
        Overrides:
        paint in class PainterText
        Parameters:
        g - The graphics.
        state - The game state.
      • changeSizeFromFormatString

        protected void changeSizeFromFormatString()
        Changes the text size according to a format string.
        Overrides:
        changeSizeFromFormatString in class PainterText
      • getFont

        protected Font getFont​(java.lang.String name,
                               int style,
                               int size)
        Gets the font by fontname, style and size by regarding the scaling factor.
        Overrides:
        getFont in class PainterText
        Parameters:
        name - The font name
        style - The font style
        size - The font size (for 1024 Px width)
        Returns:
        The font.