Package com.starpoints.painter
Interface Painter
-
- All Known Implementing Classes:
Painter2DArena
,PainterBackground
,PainterBackgroundAnimation
,PainterBase
,PainterConfirmMenu
,PainterControlButtons
,PainterCredits
,PainterDimmer
,PainterEditorHelp
,PainterEditorMenu
,PainterEditorProps
,PainterFieldEditor
,PainterFlashAnimation
,PainterFlashAnimationEditor
,PainterFlashAnimationInfoMenu
,PainterFlashAnimationItemProps
,PainterFlashAnimationItems
,PainterFlashAnimationPlanets
,PainterGameDimmer
,PainterGameFinishedAnimation
,PainterGameMenu
,PainterGameMessage
,PainterGraphicSoundOptions
,PainterInventory
,PainterKeyboard
,PainterKeyboardOptions
,PainterLeagueBoard
,PainterLeagueOptions
,PainterLeaguePlayers
,PainterLevelColors
,PainterLevelEnemies
,PainterLevelFogs
,PainterLevelInfo
,PainterLevelInfoMenu
,PainterLevelIntro
,PainterLevelItems
,PainterLevelOverview
,PainterLevelProps
,PainterLevelSetsMenu
,PainterMainMenu
,PainterMenu
,PainterMenuHorizontal
,PainterMenuKeyboard
,PainterMessageText
,PainterNetworkMenu
,PainterOptions
,PainterPlayerInfos
,PainterSavedGamesMenu
,PainterSet
,PainterShop
,PainterShopEditor
,PainterShopInfoMenu
,PainterShopItemProps
,PainterShopItems
,PainterShopProps
,PainterSkinSelection
,PainterTabbedMenu
,PainterText
,PainterThingProps
,PainterTutorial
public interface Painter
Painter interface for graphic effects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description Rectangle
getArea()
Gets the display area for this Painter.int
getBaseHeight()
Gets the base height of this painter.int
getBaseWidth()
Gets the base width of this painter.double
getXFactor()
Returns an painter specific x scaling factor.double
getYFactor()
Returns a painter specific y scaling factor.boolean
isActive()
Checks, if this painter is currently active and wants to handle events.void
onStartGame(GameState state)
Called if new game is started.void
paint(Graphics g, GameState state)
Paints on the screen.void
setArea(Rectangle area)
Sets the display area for this Painter.void
setOptions(Options opt)
Sets the options for this Painter.void
setState(GameState state)
Sets the game state.
-
-
-
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.
-
-