/* Copyright 2017 Miguel Gonzalez Sanchez
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

package de.bitbrain.braingdx.graphics.renderer;

import com.badlogic.gdx.assets.AssetManager;
import com.badlogic.gdx.graphics.Texture;
import com.badlogic.gdx.graphics.g2d.Batch;
import com.badlogic.gdx.graphics.g2d.Sprite;

import de.bitbrain.braingdx.assets.SharedAssetManager;
import de.bitbrain.braingdx.graphics.GameObjectRenderManager;
import de.bitbrain.braingdx.world.GameObject;

/**
 * Renderer implementation for sprites.
 *
 * @since 1.0.0
 * @version 1.0.0
 * @author Miguel Gonzalez Sanchez
 */
public class SpriteRenderer implements GameObjectRenderManager.GameObjectRenderer {

   protected Sprite sprite;
   private final AssetManager assets = SharedAssetManager.getInstance();
   private String textureId;
   private Texture texture;

   public SpriteRenderer(String textureId) {
      this.textureId = textureId;
   }

   public SpriteRenderer(Texture texture) {
      this.texture = texture;
   }

   @Override
   public void init() {
      if (textureId != null) {
         texture = assets.get(textureId, Texture.class);
      }
      sprite = new Sprite(texture);
   }

   @Override
   public void render(GameObject object, Batch batch, float delta) {
      sprite.setPosition(object.getLeft() + object.getOffset().x, object.getTop() + object.getOffset().y);
      sprite.setSize(object.getWidth(), object.getHeight());
      sprite.setColor(object.getColor());
      sprite.setScale(object.getScale().x, object.getScale().y);
      sprite.draw(batch, 1f);
   }
}

@@ -821,16 +821,54 @@
 .Sprite;
+%0Aimport com.badlogic.gdx.math.Vector2;
 %0A%0Aimport
@@ -1387,16 +1387,65 @@
 texture;
+%0A   private final Vector2 offset = new Vector2();
 %0A%0A   pub
@@ -1770,32 +1770,166 @@
 texture);%0A   %7D%0A%0A
+   public void setOffset(float x, float y) %7B%0A      offset.set(x, y);%0A   %7D%0A%0A   public Vector2 getOffset() %7B%0A      return offset;%0A   %7D%0A%0A
    @Override%0A   
@@ -2054,25 +2054,48 @@
 etOffset().x
-,
+ + offset.x,%0A           
  object.getT
@@ -2117,24 +2117,35 @@
 etOffset().y
+ + offset.y
 );%0A      spr

Add offset to SpriteRenderer