public static void drawHorizontalAlphaLine(int x, int y, int length, int color, int alphaValue) {
		if (y < startY || y >= endY)
			return;
		if (x < startX) {
			length -= startX - x;
			x = startX;
		}
		if (x + length > endX)
			length = endX - x;
		int alpha = 256 - alphaValue;
		int red = (color >> 16 & 0xff) * alphaValue;
		int green = (color >> 8 & 0xff) * alphaValue;
		int blue = (color & 0xff) * alphaValue;
		int pixel = x + y * width;
		for (int index = 0; index < length; index++) {
			int r = (pixels[pixel] >> 16 & 0xff) * alpha;
			int g = (pixels[pixel] >> 8 & 0xff) * alpha;
			int b = (pixels[pixel] & 0xff) * alpha;
			int pixelColor = ((red + r >> 8) << 16) + ((green + g >> 8) << 8) + (blue + b >> 8);
			pixels[pixel++] = pixelColor;
		}

	}