@@ -0,0 +1,2624 @@
+package de.bitbrain.braingdx.graphics;%0A%0Aimport com.badlogic.gdx.graphics.Camera;%0Aimport com.badlogic.gdx.graphics.Color;%0Aimport com.badlogic.gdx.graphics.Texture;%0Aimport com.badlogic.gdx.graphics.g2d.Batch;%0Aimport com.badlogic.gdx.graphics.g2d.Sprite;%0A%0Aimport de.bitbrain.braingdx.assets.SharedAssetManager;%0A%0Apublic class ParallaxMap %7B%0A%0A   private Sprite sprite;%0A%0A   private Camera camera;%0A%0A   private float paralaxity;%0A%0A   private float width, height;%0A%0A   public ParallaxMap(String textureId, Camera camera, float paralaxity) %7B%0A      this(SharedAssetManager.getInstance().get(textureId, Texture.class), camera, paralaxity);%0A   %7D%0A%0A   public ParallaxMap(Texture texture, Camera camera, float paralaxity) %7B%0A      this.camera = camera;%0A      this.sprite = new Sprite(texture);%0A      this.paralaxity = paralaxity;%0A      this.width = sprite.getWidth();%0A      this.height = sprite.getHeight();%0A   %7D%0A%0A   public void scale(float scale) %7B%0A      this.width *= scale;%0A      this.height *= scale;%0A   %7D%0A%0A   public void setColor(Color color) %7B%0A      sprite.setColor(color);%0A   %7D%0A%0A   public void setAlpha(float alpha) %7B%0A      sprite.setAlpha(alpha);%0A   %7D%0A%0A   public void draw(Batch batch) %7B%0A%0A      float x = camera.position.x - camera.viewportWidth / 2f;%0A      float y = camera.position.y - camera.viewportHeight / 2f;%0A      float width = camera.viewportWidth;%0A      float height = camera.viewportHeight;%0A      int boundableX = (int) Math.floor(x);%0A      int boundableY = (int) Math.floor(y);%0A      for (float tmpX = getStartX(x) + boundableX; tmpX %3C width + this.width + boundableX; tmpX += this.width) %7B%0A         for (float tmpY = getStartY(y) + boundableY; tmpY %3C height + this.height + boundableY; tmpY += this.height) %7B%0A            sprite.setBounds(tmpX + getXClip(x), tmpY + getYClip(y), this.width, this.height);%0A            sprite.draw(batch);%0A         %7D%0A      %7D%0A   %7D%0A%0A   private float getTargetX(float focusX) %7B%0A      return Math.round(Math.floor(-focusX / paralaxity));%0A   %7D%0A%0A   private float getTargetY(float focusY) %7B%0A      return Math.round(Math.floor(-focusY / paralaxity));%0A   %7D%0A%0A   private int getStartX(float focusX) %7B%0A      int startX = 0;%0A      if (getTargetX(focusX) %3E 0) %7B%0A         startX = Math.round(-width);%0A      %7D%0A      return startX;%0A   %7D%0A%0A   private int getStartY(float focusY) %7B%0A      int startY = 0;%0A      if (getTargetY(focusY) %3E 0) %7B%0A         startY = Math.round(-height);%0A      %7D%0A      return startY;%0A   %7D%0A%0A   private int getXClip(float focusX) %7B%0A      return Math.round(getTargetX(focusX) %25 width);%0A   %7D%0A%0A   private int getYClip(float focusY) %7B%0A      return Math.round(getTargetY(focusY) %25 height);%0A   %7D%0A%7D

implement ParallaxMap, closes #12