Computer Science Canada Mouse Commands |
Author: | jakey140 [ Tue Dec 19, 2006 7:44 pm ] |
Post subject: | Mouse Commands |
I Am trying to write a program using procedures (title, userInput, goodBye) that will display three different sized squares on the screen all in a row, each a different colour, so that when the user clicks on the squares, the program will display a message stating the size of the square (small, medium or large, and then exit when the user clicks on the word Exit, displayed in a rectangle at the lower centre of the screen... Any Ideas or starting points? |
Author: | uberwalla [ Tue Dec 19, 2006 7:56 pm ] |
Post subject: | |
my idea of where to start would be the Turing Walkthrough. take a look at the mouse.where command. also theres always the turing reference. |
Author: | jakey140 [ Tue Dec 19, 2006 11:05 pm ] | ||
Post subject: | |||
heres what I have so far.... I just need to make a few minor adjustments and I should Be set...
|
Author: | uberwalla [ Tue Dec 19, 2006 11:18 pm ] |
Post subject: | |
ok well i was going to run to see what you had to try to give ya some help but then i noticed this... Quote: procedure display %draw three boxes on the screen drawfillbox (20, 20, 40, 40, green) drawfillbox (60, 20, 100, 60, yellow) drawfillbox (120, 20, 180, 80, red) drawbox (290, 0, 350, 30, 0) locatexy (300, 15) put "exit" procedure display mousewhere (rangex, rangey, button) u declare display twice and dont even end the first one. which one is supposed to be used? |
Author: | jakey140 [ Tue Dec 19, 2006 11:20 pm ] |
Post subject: | |
the bottom one... ive tried including the drawfillbox's in the display procedure as well but for some reason it messes up... take a look |
Author: | uberwalla [ Tue Dec 19, 2006 11:27 pm ] | ||
Post subject: | |||
ok i cleaned up your code a bit so it dont make long boxes and repeating word 'exit' going up the screen...
what was happening is for some reason the locatexy was screwing with the prog. also i added font.draw instead so it dont put a white strip over the boxes. |
Author: | jakey140 [ Tue Dec 19, 2006 11:36 pm ] |
Post subject: | |
awsome... thanks alot ![]() |
Author: | ZeroPaladn [ Wed Dec 20, 2006 8:47 am ] | ||
Post subject: | |||
you have to declare a font for Font.Draw. If you are looking for the font that the run window uses for the put statement, then just click on file, then preferences, then go to Run Window, and see the font there. Insert it into your font variable, and there you have it. Here, I'll be nice...
|