예제 #1
0
  /**
   * 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();
  }
예제 #2
0
파일: OSprite.java 프로젝트: Aezakme/Bethie
 void setOrigin(Vector2f vec) {
   sprite.setOrigin(vec);
 }
예제 #3
0
파일: OSprite.java 프로젝트: Aezakme/Bethie
 void setPosition(int x, int y) {
   sprite.setPosition(x, y);
 }
예제 #4
0
파일: OSprite.java 프로젝트: Aezakme/Bethie
 OSprite(Texture texture) {
   sprite = new Sprite();
   sprite.setTexture(texture);
 }
예제 #5
0
 public int getY() {
   return (int) itemSprite.getPosition().y;
 };
예제 #6
0
 public int getX() {
   return (int) itemSprite.getPosition().x;
 }; // for collison dector