public void render(Graphics2D g) { texture.render(g, x, y); // if (Game.DEBUG) { // g.setColor(Color.RED); // g.draw(getTop()); // g.setColor(Color.BLUE); // g.draw(getBottom()); // g.setColor(Color.MAGENTA); // g.draw(getLeft()); // g.setColor(Color.ORANGE); // g.draw(getRight()); // } }
public Rectangle getLeft() { return new Rectangle((int) x, (int) y + 6, 4, texture.getHeight() - 6); }
public Rectangle getRight() { return new Rectangle((int) x + texture.getWidth() - 4, (int) y + 6, 4, texture.getHeight() - 6); }
public Rectangle getBottom() { return new Rectangle((int) x + 6, (int) y + texture.getHeight() - 4, texture.getWidth() - 6, 4); }
public Rectangle getTop() { return new Rectangle((int) x + 6, (int) y, texture.getWidth() - 6, 4); }
public Rectangle getBounds() { return new Rectangle((int) x, (int) y, texture.getWidth(), texture.getHeight()); }