Hi, I've built a mini rubiks cube, but to spin it, you can click anywhere and drag it and to twist it you have to use the JButtons below:
Rubiks Cube I would like it so... if you press the mouse on an area OUTSIDE of the cube, you can SPIN, and pressing the mouse on an area INSIDE the cube lets you twist(thereby replacing the JButtons).
Instead of using more mathematics to determine if the mouse pointer is outside the cube, is it possible to grab the colour of the pixel at the point where the mouse is pressed?
I know with BuffferedImages you can use getRGB(), but this is just a JPanel with a stuff drawn into it.
Basically, if the colour grabbed is the same as the background colour, then its outside of the cube.
Can anyone help? Thanks very much.