How to Disable/Enable Mouse

Get help using Construct 2

Post » Sat Jul 19, 2014 12:47 pm

How to Disable/Enable Mouse?
I want to built shooting game, when my ammo = 0, I need to disable mouse and after reload enable.
B
4
S
1
Posts: 27
Reputation: 410

Post » Sat Jul 19, 2014 1:13 pm

Hi, welcome to the forum.

There are lots of ways. Did you think of any ideas?

A couple of ways..

You can have a variable MouseEnabled which can be 1 for mouse enabled or 0 for mouse disabled. Set it to 0 when ammo=0 and 1 after reload. On your mouse events, also have the condition that this variable = 1

or

Have the mouse events in a group, and disable the group when ammo=0; enable it after reload.

Be sure to search forum and tutorials. For sure you will find something.
B
24
S
9
G
4
Posts: 1,646
Reputation: 6,596

Post » Sat Jul 19, 2014 1:18 pm

What would you like to disable about the mouse?
Do you mean disable the events regarding to mouse input?

There are many ways this can be done, but the easiest way would be to create a global variable, you could call it IsReloading and add a condition to all events regarding mouse input that they only work if IsReloading is 0 and set that variable to 1 while reloading..
After reload is finished set the variable back to 0 and the mouse input will be enabled again..

Ninjaad by @codah.. :(
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Sat Jul 19, 2014 1:20 pm

You can't disable the mouse plugin, but you can disable the mouse group and after load enable it.
The best way is to make load variable like this :
You do not have the required permissions to view the files attached to this post.
B
60
S
10
G
10
Posts: 1,013
Reputation: 9,155

Post » Sat Jul 19, 2014 3:49 pm

Thank You Very Much!
Now I understand.
B
4
S
1
Posts: 27
Reputation: 410


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 22 guests