Current Forum: Homework 6 - Part II |
Date: Tue Dec 4 2001 9:49 pm |
Author: White, David <white3@andrew.cmu.edu> |
Subject: Easier GUI picking fix... |
|
|
I got tired of trying to place the pieces exactly in the right spot. I figured out how to change the GUI to give a bigger pick tolerance...
Do the following to GraphicsGame.java This is in the function: getNode of the MouseTest class. Comment out the following lines as shown, then replace with code following. I just made the range larger by 8 pixels in each direction... Seems to be much easier now... // if (14// tempy=1; // else if (87// tempy=2; // else if (158// tempy=3; // else if (227// tempy=4; // else if (297// tempy=5; // else if (368// tempy=6; // else if (436// tempy=7;
// if (93// tempx=1; // else if (168// tempx=2; // else if (239// tempx=3; // else if (308// tempx=4; // else if (378// tempx=5; // else if (448// tempx=6; // else if (516// tempx=7; if (8 tempy=1; else if (71 tempy=2; else if (150 tempy=3; else if (219 tempy=4; else if (289 tempy=5; else if (360 tempy=6; else if (428 tempy=7;
if (85 tempx=1; else if (160 tempx=2; else if (231 tempx=3; else if (300 tempx=4; else if (370 tempx=5; else if (440 tempx=6; else if (508 tempx=7; |
|