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 PainterPainter interface for graphic effects.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description RectanglegetArea()Gets the display area for this Painter.intgetBaseHeight()Gets the base height of this painter.intgetBaseWidth()Gets the base width of this painter.doublegetXFactor()Returns an painter specific x scaling factor.doublegetYFactor()Returns a painter specific y scaling factor.booleanisActive()Checks, if this painter is currently active and wants to handle events.voidonStartGame(GameState state)Called if new game is started.voidpaint(Graphics g, GameState state)Paints on the screen.voidsetArea(Rectangle area)Sets the display area for this Painter.voidsetOptions(Options opt)Sets the options for this Painter.voidsetState(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.
-
-