very new and can't find an answer

Get help using Construct 2

Post » Tue Feb 11, 2014 11:50 am

I'm sure this is so simple for some of you and I'm also sure that days from now I will say the same. I've searched but can't find my answer.

How do I change a sprite\image after clicking a button?
B
4
Posts: 10
Reputation: 222

Post » Tue Feb 11, 2014 11:54 am

I am not sure if this is your question...If you double click on a sprite in layout you get an windows with an icon (folder) "load an image from a file"...
B
17
S
5
G
2
Posts: 173
Reputation: 2,085

Post » Tue Feb 11, 2014 11:59 am

Sorry. should have been more specific. When inside a game. How to a make a sprite change to a different image when a button is clicked?
B
4
Posts: 10
Reputation: 222

Post » Tue Feb 11, 2014 12:03 pm

Ah!! you can use:

ON touched (clicked) "sprite":
--->"sprite" destroy
--->system create object (layer, positionx, positiony)
//whit this last line you introduce the new sprite you want in the position of older sprite you destroy
You can do this other ways but I hope this help youTarkion2014-02-11 12:04:28
B
17
S
5
G
2
Posts: 173
Reputation: 2,085

Post » Tue Feb 11, 2014 12:05 pm

Thank you!
so I'm assuming the second line (destroy) is used inside the button I click.
Got it.speedstr2014-02-11 12:06:26
B
4
Posts: 10
Reputation: 222

Post » Tue Feb 11, 2014 12:09 pm

Replacing images/changing them, is covered in the beginners guide tutorial.

If you have not tried this yet, I can surely advise it as it will make your development experience a lot easier :)
Who dares wins
B
57
S
17
G
21
Posts: 1,878
Reputation: 19,567

Post » Tue Feb 11, 2014 12:12 pm

well duh! I didn't even look in the tutorials. Thanks for the tip. It's too early to think.
B
4
Posts: 10
Reputation: 222


Return to How do I....?

Who is online

Users browsing this forum: purplemonkey, tdcostas and 5 guests