Posted: Fri Jan 25, 2013 7:27 pm Post subject: how do you output the number you click on?
so i have an array of random numbers from 1,10. when you run the program these 10 numbers are randomly arranged in a grid. When i click on one of them, how do i make it output, "the number you clicked on was __". I have everything but that. Thanks!
Sponsor Sponsor
DemonWasp
Posted: Fri Jan 25, 2013 8:34 pm Post subject: RE:how do you output the number you click on?
Break it down. To figure out which number the user clicked on, you need:
1. To detect the click.
2. To figure out which grid cell the click was in.
3. To figure out which number was drawn in that grid cell.
Start by trying to do #1.
red1396
Posted: Fri Jan 25, 2013 9:59 pm Post subject: Re: how do you output the number you click on?
and to detect the click i would need to use the Mouse.Where function and say that if the x and y coordinates are within a certain range and button=0 then it is a click. Right? whats next? How do i go about doing #3?thanks:)
Insectoid
Posted: Fri Jan 25, 2013 10:02 pm Post subject: RE:how do you output the number you click on?
You need to find a way to make each button correspond with a number.
evildaddy911
Posted: Sat Jan 26, 2013 9:50 am Post subject: Re: how do you output the number you click on?
red1396 @ Fri Jan 25, 2013 9:59 pm wrote:
and to detect the click i would need to use the Mouse.Where function and say that if the x and y coordinates are within a certain range and button=0 then it is a click. Right? whats next? How do i go about doing #3?thanks:)
almost. when button = 0 then there was NO click
red1396
Posted: Sat Jan 26, 2013 2:36 pm Post subject: Re: how do you output the number you click on?
ooops yep your right. when button not = 0 then its a click. But HOW do i do step 3? can you please give me some code?