@Override protected void onRender(SpriteBatch batch, OrthoCamera cam){

		try {
			
			this.owner.setDrawOrder((int)-this.owner.getPosition().y);
			
			if(this.sprite == null || this.owner.getMaterial().getTextureRegion() == null || batch == null) {
				System.out.println("couldn't render sprite");
				return;
			}

			Material mat = this.owner.getMaterial();
			this.owner.getCenter().x = mat.getWidth()/2;
			this.owner.getCenter().y = mat.getHeight()/2;
			
			this.sprite.setRegion(mat.getTextureRegion());
			this.sprite.setSize(mat.getWidth(), mat.getHeight());
			this.sprite.setScale(owner.getScale().x,owner.getScale().y);
			this.sprite.setPosition(owner.getPosition().x, owner.getPosition().y);
			this.sprite.setRotation(owner.getRotation());
			this.sprite.setColor(mat.getColor());
			this.sprite.setOrigin(this.owner.getCenter().x, this.owner.getCenter().y);
			
			if(cam.rectInBounds(this.sprite.getBoundingRectangle())){
				this.sprite.draw(batch);
			} 
			
		} catch (Exception e){
			System.out.println(e.getMessage());
		}
	}