Maybe I should be more helpful to you all.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
| pixel = new int[height][width]; for (int i = 0; i < height; i++){ for(int j = 0; j < width; j++){ pixel[i][j] = pixelData[i*j]; } } pixel[30][60] = 0xCC0000; for(int i = 0; i < pixel.length;i++){ for(int j = 0; j < pixel[i].length; j++){ pixelData[i*j] = pixel[i][j]; } } |
I did a bit more, figured it out and I am able to change pixels by simply going pixelData
- = etc. But now this has come up.
this is where my problem lies. I want to convert the 1D array from the bufferstrategy into a 2D Cartesian array (for ease of use), and then input my 2D stuff back into the 1D pixelData but you see when I change the pixel[30][60] to 0xCC0000 (or any coordinate/colour) it doesn't work, nothing shows except the black default. I know this lies in the array but that's where my brain shuts down on me
