20 package net.sf.gridarta.model.gameobject;
22 import java.awt.Dimension;
23 import org.jetbrains.annotations.NotNull;
34 private static final int X_DIM = 32;
63 final int sum = size.width + size.height;
64 width = sum * isoMapSquareInfo.getXLen2();
65 height = sum * isoMapSquareInfo.getYLen2();
66 data =
new int[width *
height];
68 for (
int y = 0; y < size.height; y++) {
69 for (
int x = 0; x < size.width; x++) {
70 data[index++] = (x + size.height - y - 1) * isoMapSquareInfo.getXLen2();
71 data[index++] = (x + y) * isoMapSquareInfo.getYLen2();
74 yLen = isoMapSquareInfo.getYLen();
85 return data[positionID * 2];
96 return height - yLen - data[1 + positionID * 2];
int getWidth()
Returns the total width of a multi-square image.
MultiPositionEntry(@NotNull final IsoMapSquareInfo isoMapSquareInfo, @NotNull final Dimension size)
Creates a new instance.
static final int X_DIM
Number of columns in the array.
final int yLen
The vertical size of a square.
Encapsulated information about a multi-square image.
int getHeight()
Returns the total height of a multi-square image.
int getXOffset(final int positionID)
Returns the x offset from the left-most pixel of the multi-square image and the default x position...
final int [] data
Array with position data.
Provides information about isometric map squares.
int getYOffset(final int positionID)
Returns the y offset from the left-most pixel of the multi-square image and the default y position...
final int width
The total width of the multi-square image in pixels.
final int height
The total height of the multi-square image in pixels.