Quick instance question

Get help using Construct 2

Post » Sun Jan 22, 2012 7:09 pm

I have a level select screen.

On the level select screen i have 20 levels, Each are just instances of the same object.

I also have 20 text boxes, again just a instance of each other.

Both the level Image and the textbox have a instance variable called Level. All are numbered 1 - 20.

If the mouse is over the textbox and the instance is level1 then i want the corresponding level image to go to frame 2. But i can't wrap my mind around this

ps, I can't share my capx.
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Jan 22, 2012 7:11 pm

Wait never mind.. Figured it out
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Jan 22, 2012 7:18 pm

Wait not quite, Its changing all the instances frame. I need the one instance at a time..
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Jan 22, 2012 7:58 pm

Check again the How do I FAQ section "Picking".
The topic about UID and the very last one listed should give you the answer you're looking for.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786

Post » Sun Jan 22, 2012 8:11 pm

@Kyatric, I had a look at them but i still do not understand.

Bu looking at the treads I guess im supposed to use the nth term. But I dont get what the nth is..

Like i said above i have 20 textboxes and 20 images all of the same instance but both have instance variables called level.

If the mouse is over the text object which has a instance of 1 then i need the image with the instance of 1 to go to frame 1..

Any ideas?
B
29
S
12
G
7
Posts: 740
Reputation: 7,839

Post » Sun Jan 22, 2012 9:27 pm

[code]Mouse:on cursor over textbox
Sprite: .level = textbox.level
.. -> Sprite: set animation frame[/code]

This picks the textbox and the according sprite.
New to Construct ? Where to start

Image Image
Image Image

Please attach a capx to any help request or bug report !
Moderator
B
247
S
85
G
40
Posts: 6,998
Reputation: 57,786

Post » Sun Jan 22, 2012 10:12 pm

Thanks @Kyatric I was close to that But not close enough
B
29
S
12
G
7
Posts: 740
Reputation: 7,839


Return to How do I....?

Who is online

Users browsing this forum: Governador, Radulepy, tarek2, Thelegendvinny, TiagoCesar and 23 guests