public void setBoundedX(double targetX, int width, double left, double right){
		if (targetX < left) {
			targetX = left;
		} else if (targetX + width > right) {
			targetX = right - width;
		}

		this.setX(targetX);
	}