Interface HexDrawPlugin
public interface HexDrawPlugin
HexDrawPlugins can be given to a BoardView and will be called whenever the BoardView draws any of its hexes to the
hex image cache. In this way the draw process can be adapted to different situations (board editor, preview, game)
without changing the BoardView itself (and making it ever bigger). Also, since the results are cached, the draw
process can be used for many hexes without making the BoardView slow.
Note that at the moment, these plugins will always draw last, i.e. above everything else that gets drawn to the image cache. As sprites get drawn deparately, they will draw above plugins.
-
Method Summary
-
Method Details
-
draw
Draws graphics content to the present hex image. Unlike sprites the contents drawn here will become part of the cached hex images. Drawing should be done to the provided graphics2D using information from the hex, game and boardview if necessary. Note that the available area of the hex image depends on the boardview's scale. When the scale is 1, the area is the usual hex shape within a rectangle of 84x72 (HEX_W x HEX_H). At other scales, the rectangle is scaled accordingly.- Parameters:
graphics2D
- The Graphics to draw tohex
- The Hex currently drawngame
- the Gamecoords
- the location of the hex on the boardboardView
- The boardview that is calling this method- See Also:
-