20 package net.sf.gridarta.gui.map.renderer;
22 import java.awt.Graphics2D;
23 import javax.swing.ImageIcon;
31 import org.jetbrains.annotations.NotNull;
77 super(mapModel, isoMapSquareInfo);
85 protected void paint(@NotNull
final Graphics2D graphics2D,
final int xStart,
final int yStart, @NotNull
final G gameObject) {
88 final int yOffset = icon.getIconHeight() - isoMapSquareInfo.
getYLen();
96 icon.paintIcon(
this, graphics2D, x, y);
100 icon.paintIcon(
this, graphics2D, x, y);
105 if (icon.getIconWidth() > isoMapSquareInfo.
getXLen()) {
106 xOffset = (icon.getIconWidth() - isoMapSquareInfo.
getXLen()) / 2;
108 icon.paintIcon(
this, graphics2D, xStart - xOffset, yStart - yOffset);
115 paint(graphics2D, xStart, yStart, mob);
ImageIcon getNormalImage()
Returns the normal face for this GameObject.
T getHead()
Return the head part of a multi-part object.
Renders maps without MapGrid or validation errors.
static final long serialVersionUID
The serial version UID.
int getYOffset(final int shapeID, final int positionID)
Calculate the y-offset from the topmost pixel of the big face image and the default y-position (The d...
A MapModel reflects the data of a map.
String getFaceObjName()
Returns the face name, can be from animation or face.
void paint(@NotNull final Graphics2D graphics2D, final int xStart, final int yStart, @NotNull final G gameObject)
G getContainerGameObject()
Returns the environment game object if this game object is in the inventory or.
int getMultiRefCount()
Returns the number of parts for multi-part heads.
int getYLen()
Returns the vertical size of a square.
Base package of all Gridarta classes.
G getFirst()
Return the first GameObject contained in this container.
Reflects a game object (object on a map).
final MultiPositionData multiPositionData
The MultiPositionData to query for multi-part objects.
final ImageIcon unknownSquareIcon
The icon for unknown squares.
final IsoMapSquareInfo isoMapSquareInfo
The IsoMapSquareInfo to use.
GameObjects are the objects based on Archetypes found on maps.
SimpleIsoMapRenderer(final int spawnPointTypeNo, @NotNull final MapModel< G, A, R > mapModel, @NotNull final MultiPositionData multiPositionData, @NotNull final IsoMapSquareInfo isoMapSquareInfo, @NotNull final ImageIcon unknownSquareIcon)
Creates a new instance.
The MultiPositionData class stores an array of numbers which is required in order to calculate displa...
final int spawnPointTypeNo
The game object type number of spawn points.
Provides information about isometric map squares.
R getArchetype()
Returns the Archetype this GameObject is based on.
boolean isMulti()
Returns whether this Archetype is a multi-part object.
int getXOffset(final int shapeID, final int positionID)
Calculate the x-offset from the leftmost pixel of the big face image and the default x-position (The ...
Abstract base class for ISO MapRenderers.
final MapModel< G, A, R > mapModel
The MapModel to render.
int getXLen()
Returns the horizontal size of a square.
Interface for MapArchObjects.
int getTypeNo()
Returns the type number of this Archetype.