/** * Returns the index of the current tile, relative to a standard scan-line * order. * * @return The current tile's index (starts at 0). * */ public int getTileIdx() { return getNumXTiles() * co.y + co.x; }
/** * Returns the index of the current tile, relative to a standard scan-line * order. * * @return The current tile's index (starts at 0). * */ public int getTileIdx() { return getNumXTiles() * co.y + co.x; }
/** * Returns the index of the current tile, relative to a standard scan-line * order. * * @return The current tile's index (starts at 0). * */ public int getTileIdx() { return getNumXTiles() * co.y + co.x; }
/** * Changes the current tile, given the new coordinates. * * @param x The horizontal coordinate of the tile. * * @param y The vertical coordinate of the new tile. * */ public void setTile(int x, int y) { if (x >= getNumXTiles()) { y += x/ getNumXTiles(); x = x % getNumXTiles(); } co.x = x; co.y = y; aTile = null; }
/** * Changes the current tile, given the new coordinates. * * @param x The horizontal coordinate of the tile. * * @param y The vertical coordinate of the new tile. * */ public void setTile(int x, int y) { if (x >= getNumXTiles()) { y += x/ getNumXTiles(); x = x % getNumXTiles(); } co.x = x; co.y = y; aTile = null; }
/** * Changes the current tile, given the new coordinates. * * @param x The horizontal coordinate of the tile. * * @param y The vertical coordinate of the new tile. * */ public void setTile(int x, int y) { if (x >= getNumXTiles()) { y += x/ getNumXTiles(); x = x % getNumXTiles(); } co.x = x; co.y = y; aTile = null; }
/** * Returns the total number of tiles in the image. This default * implementation assumes no tiling, so 1 is always returned. * * @return The total number of tiles in the image. * */ public int getNumTiles() { return getNumXTiles() * getNumYTiles(); }
/** * Advances to the next tile, in standard scan-line order (by rows then * columns). * */ public void nextTile() { co.x++; if (co.x >= getNumXTiles()) { co.x = 0; co.y++; } setTile(co.x, co.y); }
/** * Advances to the next tile, in standard scan-line order (by rows then * columns). * */ public void nextTile() { co.x++; if (co.x >= getNumXTiles()) { co.x = 0; co.y++; } setTile(co.x, co.y); }
/** * Returns the total number of tiles in the image. This default * implementation assumes no tiling, so 1 is always returned. * * @return The total number of tiles in the image. * */ public int getNumTiles() { return getNumXTiles() * getNumYTiles(); }
/** * Advances to the next tile, in standard scan-line order (by rows then * columns). * */ public void nextTile() { co.x++; if (co.x >= getNumXTiles()) { co.x = 0; co.y++; } setTile(co.x, co.y); }
/** * Returns the total number of tiles in the image. This default * implementation assumes no tiling, so 1 is always returned. * * @return The total number of tiles in the image. * */ public int getNumTiles() { return getNumXTiles() * getNumYTiles(); }
/** * Returns the number of tiles in the horizontal and vertical * directions. * * @param co If not null this object is used to return the information. If * null a new one is created and returned. * * @return The number of tiles in the horizontal (Point.x) and vertical * (Point.y) directions. * */ public Point getNumTiles(Point co) { if (co != null) { co.x = getNumXTiles(); co.y = getNumYTiles(); return co; } else { return new Point(getNumXTiles(), getNumYTiles()); } }
/** * Returns the number of tiles in the horizontal and vertical * directions. * * @param co If not null this object is used to return the information. If * null a new one is created and returned. * * @return The number of tiles in the horizontal (Point.x) and vertical * (Point.y) directions. * */ public Point getNumTiles(Point co) { if (co != null) { co.x = getNumXTiles(); co.y = getNumYTiles(); return co; } else { return new Point(getNumXTiles(), getNumYTiles()); } }
/** * Returns the number of tiles in the horizontal and vertical * directions. * * @param co If not null this object is used to return the information. If * null a new one is created and returned. * * @return The number of tiles in the horizontal (Point.x) and vertical * (Point.y) directions. * */ public Point getNumTiles(Point co) { if (co != null) { co.x = getNumXTiles(); co.y = getNumYTiles(); return co; } else { return new Point(getNumXTiles(), getNumYTiles()); } }