public void render(int xp, int yp, Sprite sprite){
		xp -= xOffset;
		yp -= yOffset;

		for(int y = 0; y < sprite.getHeight(); y++){
			int ya = y + yp; //y absolute position is equal to y + yOffset
			int ys = y;
			for(int x = 0; x < sprite.getWidth(); x++){
				int xa = x + xp;
				int xs = x;
				if(xa < -(sprite.getWidth()) || xa >= width || ya < 0 || ya >= height) break;
				if(xa < 0) xa = 0;
				int color = sprite.getPixels()[xs + ys * sprite.getWidth()];
				if(color != colorToIgnore && color != colorToIgnore2) pixels[xa + ya * width] = color;
			}
		}
	}