Computer Science Canada Mouse CLiCK |
Author: | coolest35 [ Tue Dec 02, 2003 9:27 pm ] | ||
Post subject: | Mouse CLiCK | ||
Hi ![]() ![]() ![]() ![]() ![]() below is a part of the script i used on my battleship! lemmie now if you want the whole file .. ok.. i'h attached it so check it out.. and help me out thanx!
|
Author: | McKenzie [ Tue Dec 02, 2003 9:55 pm ] |
Post subject: | |
Clicking on a grid is a little easier. For your BS you could have basically used: x:=(mnpx-160) div 40 + 2 y:=(mnpy-159) div 40 + 1 When you are clicking on a button (and not using the GUI) your need to check 5 things mouseBtn = 1 and mouseX >= buttonX and mouseX <= buttonX + width and mouseY >= buttonY and mouseY <= buttonY + height |
Author: | coolest35 [ Tue Dec 02, 2003 11:35 pm ] |
Post subject: | what ? ?? |
i don't under stand that 1 bit.. if anyone has other ways that this can be.. done.. plz post them.. thnx ![]() |
Author: | Tony [ Wed Dec 03, 2003 12:41 am ] | ||
Post subject: | |||
eh... another way of doing it would be to grab your X/Y values... and then just figure out what cell its clicked on. Easiest example would be if grid starts at 0,0 and each cell is 10 pixels wide.
or something... basically figure out what part of the grid is being clicked. |
Author: | McKenzie [ Wed Dec 03, 2003 12:58 am ] | ||||
Post subject: | Re: Mouse CLiCK | ||||
coolest35 wrote:
When you say buttons, do you mean that you are clicking on a box to do something? Something like:
|
Author: | coolest35 [ Thu Dec 04, 2003 7:12 pm ] |
Post subject: | Yep |
Hi, i need to make a GUI Button for the following : LOAD DATA FROM KEYBOARD, LOAD DATA FROM A FILE, SHOW DATA, SHOW MOST EXPENSIVE, SHOW LEAST EXPENSIVE, SHOW AVERAGE PRICE, SHOW OUT OF STOCK, SHOW TOTAL WORTH, EXIT. How would i make them into GUI buttons.. the turing reference doesn't give me a clue.... thnx |