How do I change sprite

Get help using Construct 2

Post » Wed Dec 28, 2016 11:24 pm

Is there anyway if changing a sprite in the events sheet at start of layout?
Have been looking all day but can't find anything
Thanks
B
7
S
1
Posts: 21
Reputation: 522

Post » Thu Dec 29, 2016 1:29 am

Use Create Object in the Systems command.

Create the new sprite at the position of the one you want to change then destroy the old sprite.

As long as they have the same behaviors and your events account for the change that will work.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Thu Dec 29, 2016 11:10 am

@lamar
B
7
S
1
Posts: 21
Reputation: 522

Post » Thu Dec 29, 2016 11:11 am

@lamar
Image

change it like this
B
7
S
1
Posts: 21
Reputation: 522

Post » Thu Dec 29, 2016 2:04 pm

It would be nice if you could feed this action a variable. This behaviour should help: plugin-nickname-behavior-nickname_t74522
Image
B
29
S
9
G
3
Posts: 170
Reputation: 3,297

Post » Thu Dec 29, 2016 9:41 pm

zachal00 wrote:@lamar
Image

change it like this


Yes and if you are replacing another sprite use the Destroy command.
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Sat Dec 31, 2016 1:18 pm

@lamar
Yes but I want to be able to change the created sprite with a variable
B
7
S
1
Posts: 21
Reputation: 522

Post » Sat Dec 31, 2016 3:16 pm

zachal00 wrote:@lamar
Yes but I want to be able to change the created sprite with a variable


So set a Global variable to CHANGESPRITE

On CHANGESPRITE = number Create Object new sprite at Position old sprite and Destroy old sprite
Banned User
B
23
S
6
G
58
Posts: 1,229
Reputation: 34,540

Post » Sat Dec 31, 2016 6:15 pm

You could also ADD ANOTHER ANIMATION for that sprite and use the global variable to change it to your desired one.
Image Image Image
B
29
S
11
G
27
Posts: 729
Reputation: 16,995


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 11 guests