Discuss Scratch

SuperEtho
Scratcher
7 posts

how do i sense a mouse click anywhere?

Like when you click it senses it and then you can do whatever
UserGeneratedBot
Scratcher
37 posts

how do i sense a mouse click anywhere?

Make a sprite the covers the whole background (Like a square then set it's size to 200 or something.)
Then add “if sprite clicked” and add what you want it to do. (Also you can add a hide block if you want it invisible.)

Last edited by UserGeneratedBot (Oct. 21, 2021 18:25:12)

scritchscrutch
Scratcher
32 posts

how do i sense a mouse click anywhere?

SuperEtho wrote:

Like when you click it senses it and then you can do whatever
-
I think you already posted a thread but let me try answering again! Is this what you meant?

when green flag clicked
forever
if <mouse down?> then
wait until <not <mouse down?>>
insert your code here
end
end

The above means:
Whenever the mouse is pressed down, it'll wait until the mouse is not pressed anymore before proceeding with your other code.

Just an extra tip: If you don't put the 'wait until not mouse down?', your next code will run regardless if the user clicks or just holding their mouse button down. With the 'wait until not mouse down?' code, it'll make sure that the user completes a click before allowing other codes to run!
SuperEtho
Scratcher
7 posts

how do i sense a mouse click anywhere?

i posted this right as you answered that is why
but thank you

FmafGoat
Scratcher
1 post

how do i sense a mouse click anywhere?

scritchscrutch this helps so much thank you
Dexter2200
Scratcher
46 posts

how do i sense a mouse click anywhere?

FmafGoat wrote:

scritchscrutch this helps so much thank you
Do not necropost!!!!

Last edited by Dexter2200 (Sept. 25, 2023 02:03:11)

Powered by DjangoBB