Package com.starpoints.painter
Class PainterTutorial
- java.lang.Object
-
- com.starpoints.painter.PainterBase
-
- com.starpoints.painter.PainterText
-
- com.starpoints.painter.PainterTutorial
-
- All Implemented Interfaces:
Painter
public class PainterTutorial extends PainterText
Tutor screen item that displays the game help.
-
-
Field Summary
Fields Modifier and Type Field Description protected int
offset
y-Offset for scrolled paintingjava.lang.String[]
tutorialText
The help texts.-
Fields inherited from class com.starpoints.painter.PainterText
currentColor, currentFont, currentOpacity, index, lineIndex, paintCount, shadowOn, sideComplete, switchImmediate, text, textBuffer, xpos, ypos
-
Fields inherited from class com.starpoints.painter.PainterBase
area, areas, bigFont, controller, gameInfo, medFont, mouseArea, oldMouseArea, options, smallFont, state, verysmallFont, xfactor, yfactor
-
-
Constructor Summary
Constructors Constructor Description PainterTutorial()
Creates a new ItemTutor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
changeSizeFromFormatString()
Changes the text size according to a format string.int
getBaseHeight()
Gets the base height of this painter.int
getBaseWidth()
Gets the base width of this painter.protected Font
getFont(java.lang.String name, int style, int size)
Gets the font by fontname, style and size by regarding the scaling factor.void
paint(Graphics g, GameState state)
Paints the text to the screen.void
setArea(Rectangle area)
Sets the size for this Painter.void
switchToNextLevel(GameState state)
Switches to the next levels help texts.void
update(UpdateInfo ui)
Updates the game info to display.-
Methods inherited from class com.starpoints.painter.PainterText
changeColorFromFormatString, changeFontFromFormatString, displayImageFromFormatString, displayText, inititialize, pauseFromFormatString, setColor, setFont, setText, stepToStrongTabFromFormatString, stepToTabFromFormatString, stepYFromFormatString, switchShadowFromFormatString, switchToNext
-
Methods inherited from class com.starpoints.painter.PainterBase
draw, drawShaded, drawShaded, getArea, getEditor, getHeight, getIndent, getRepaintFactor, getWidth, getXFactor, getYFactor, isActive, isInputController, onStartGame, setController, setFontSize, setLevel, setOptions, setState
-
-
-
-
Method Detail
-
getBaseWidth
public int getBaseWidth()
Gets the base width of this painter.- Specified by:
getBaseWidth
in interfacePainter
- Overrides:
getBaseWidth
in classPainterText
- Returns:
- 400.
-
getBaseHeight
public int getBaseHeight()
Gets the base height of this painter.- Specified by:
getBaseHeight
in interfacePainter
- Overrides:
getBaseHeight
in classPainterText
- Returns:
- 550.
-
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 interfacePainter
- Overrides:
setArea
in classPainterBase
- Parameters:
area
- The area.
-
paint
public void paint(Graphics g, GameState state)
Paints the text to the screen.- Specified by:
paint
in interfacePainter
- Overrides:
paint
in classPainterText
- Parameters:
g
- The graphics.state
- The game state.
-
changeSizeFromFormatString
protected void changeSizeFromFormatString()
Changes the text size according to a format string.- Overrides:
changeSizeFromFormatString
in classPainterText
-
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 classPainterText
- Parameters:
name
- The font namestyle
- The font stylesize
- The font size (for 1024 Px width)- Returns:
- The font.
-
-