Maybe I should be more helpful to you all.
pixel = new int[height][width];
//1D pixelData to 2D pixel (for cartesian coordinates)
for (int i = 0; i < height; i++){
for(int j = 0; j < width; j++){
pixel[i][j] = pixelData[i*j];
}
}
//pixel changes go here.
pixel[30][60] = 0xCC0000;
//flatten back to pixelData
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[x] = 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 