using variables to identify objects

Get help using Construct 2

Post » Fri Feb 14, 2014 5:54 pm

Hi, I'm new.

I have used variables to identify different layouts in a selection screen and it was very useful, I changed only the last part of the layouts name and that helped me use a lot less instructions.

I would like to know if there is a way to do something similar but with objects like pictures instead of layouts, I can't figure out myself how to do.

The situation is roughly comparable to a level selection screen VS a gallery in which you select different pictures to be displayed.

Basically my problem is due to the fact that I can only choose an object clicking on it with the mouse while I can choose a layout writing its name so I can add expression instead of a simple name.

Thank you for any help and hints :)
B
2
Posts: 1
Reputation: 152

Post » Fri Feb 14, 2014 6:01 pm

You can give an object a special instance variable.

Like: Name.
Object: Person

give object person a name: Person.Name="player"


To fetch it in events

Pick Person by evaluate Person.Name="player"
Action set textbox.text = Person.Name
lennaert2014-02-14 18:02:41
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,572


Return to How do I....?

Who is online

Users browsing this forum: tinhofiel and 44 guests