/** * Takes the map data are returns a Texture that can be drawn from a sprite. * * @param width How wide in pixels you want the returned Texture to be. * @param height How high in pixels you want the returned Texture to be. * @return a Texture that is width x height big that can then be drawn to the screen * @throws TextureCreationException */ ConstTexture drawMap() { int currentSlot = 0; screen.clear(); for (int x = 0; x < XSize; x++) { for (int y = 0; y < YSize; y++) { currentTile.setPosition(x * 16, y * 16); currentTile.setTexture(textures.tiles.get(textureMap.get(currentSlot))); screen.draw(currentTile); currentSlot++; } } screen.display(); return screen.getTexture(); }
void setOrigin(Vector2f vec) { sprite.setOrigin(vec); }
void setPosition(int x, int y) { sprite.setPosition(x, y); }
OSprite(Texture texture) { sprite = new Sprite(); sprite.setTexture(texture); }
public int getY() { return (int) itemSprite.getPosition().y; };
public int getX() { return (int) itemSprite.getPosition().x; }; // for collison dector