public void draw(SpriteBatch spriteBatch) { if (containingMap != null) { spriteBatch.Draw(graphic, new Rectangle((int)(position.X * containingMap.getTileWidth() + offset.X), (int)(position.Y * containingMap.getTileHeight() + offset.Y), graphic.Width, graphic.Height), Color.White); } }
public void draw(SpriteBatch spriteBatch) { if (containingMap != null) { spriteBatch.Draw(graphic, new Rectangle(position.X * tileWidth - ((graphic.Width - tileWidth) / 2), position.Y * containingMap.getTileHeight() - (graphic.Height - tileHeight), graphic.Width, graphic.Height), Color.White); } }
public void setContainingMap(Map value) { containingMap = value; tileHeight = containingMap.getTileHeight(); tileWidth = containingMap.getTileWidth(); }