How do I select one object at a time and deactivate others

Get help using Construct 2

Post » Fri Sep 09, 2016 8:37 am

I have a family called pointers.

I want that you only can select one pointer at a time, and if you go to select one while one other is actived this one is deactivated.

Is a stupid thing but after an hour i can't get it working correctly :(
B
27
S
10
G
3
Posts: 600
Reputation: 4,652

Post » Fri Sep 09, 2016 8:46 am

Guess this is related to picking objects, however there are loads of ways for picking stuff and without knowing exactly how you are trying to do this, its fairly difficult to give advise. So think you need to be a bit more specific in regards to where the problems occurs.
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Fri Sep 09, 2016 8:52 am

I have a menu with X icons.

When with the mouse i click on a icon this one is selected, ok. I use a instance variable called "active" 0/1. And when is active i set the animation to On. when is 0 animation is OFF.

Then, when i select another of the icons of the family i created i want the first one get deactivated and activate the last one.
B
27
S
10
G
3
Posts: 600
Reputation: 4,652

Post » Fri Sep 09, 2016 9:19 am

You should be able to do it like this.

Code: Select all
On Mouse click Pick Pointer

-- Pick all Pointers   -> Set Pointer.active = 0
                                        Pointer.Animationframe = <whatever it needs to be>


                                   -> Set Pointer.active = 1
                                      Pointer.Animationframe = <whatever it needs to be>



added:
Here is how it looks in C2:

Image
B
44
S
11
G
2
Posts: 1,182
Reputation: 6,848

Post » Sat Sep 10, 2016 6:38 pm

@nimos100 Worked! THANKS! :D
B
27
S
10
G
3
Posts: 600
Reputation: 4,652


Return to How do I....?

Who is online

Users browsing this forum: kriand, matriax, NN81 and 4 guests