Computer Science Canada Trying to Locate Mouse Coordinates while having the Pic.Draw not covered up by lines or coordinates |
Author: | jaki723 [ Wed May 17, 2023 4:39 pm ] | ||
Post subject: | Trying to Locate Mouse Coordinates while having the Pic.Draw not covered up by lines or coordinates | ||
What is it you are trying to achieve? To try find coordinates of my button by finding mouse coordinates (mouseX,mouseY) and use these for future codes to get the buttons working What is the problem you are having? Since the things are drawn when I have the cords written it covers the screen as it goes on top. Post any relevant code (You may choose to attach the file instead of posting the code if it is too long)
Please specify what version of Turing you are using I'm using Turing 4.1.1 |
Author: | scholarlytutor [ Wed May 17, 2023 6:01 pm ] |
Post subject: | RE:Trying to Locate Mouse Coordinates while having the Pic.Draw not covered up by lines or coordinates |
Can you repost the code with the variables (and anything else that's important) included? I've tried to run your code in Turing and I got several errors for missing variables. This is unrelated to your question, but if you have variable names like sprite14, you probably need an array to hold all of your sprites. |
Author: | jaki723 [ Wed May 17, 2023 8:34 pm ] |
Post subject: | Re: Trying to Locate Mouse Coordinates while having the Pic.Draw not covered up by lines or coordinates |
I probably do need an array, but i figured the coordinate thing if by any chance you can help with making an array for my sprites please let me know and thanks. The code should be there but if you also need images then let me know or you could just remove them from the script. |
Author: | scholarlytutor [ Thu May 18, 2023 5:55 pm ] |
Post subject: | RE:Trying to Locate Mouse Coordinates while having the Pic.Draw not covered up by lines or coordinates |
Great! The array is pretty easy. Just replace your long line of sprite variables with this: var Sprites : array 1 .. 14 of int Then, when you assign pictures to each int, you do the following: Sprites(1) := Pic.FileNew() Sprites(2) := Pic.FileNew() ... and so on. Hope that helps! |
Author: | jaki723 [ Fri May 19, 2023 3:06 pm ] |
Post subject: | Re: Trying to Locate Mouse Coordinates while having the Pic.Draw not covered up by lines or coordinates |
thx a lot thats actually really useful |