How do I add background in a new layer

Get help using Construct 2

Post » Tue Oct 11, 2016 7:25 pm

Message: kab can only post plain text URLS until they have 500 rep. 2 URLS modified. Why?
I am trying to add an image as background to represent "sky".I created a background layer and i added the sprite in that layer.However the moment i added that sprint stuffs in my main layer start disappearing(i.e bullet not showing, enemy not showing etc....What i am doing wrong ?

Buggy one ->https://www.dropbox.com/s/tgdv41k9dclqxfx/workingdemolatest-bgfix.capx?dl=0

Working one -> https://www.dropbox.com/s/bt9k1d5hab7auht/workingdemolatest.capx?dl=0
B
5
S
1
Posts: 32
Reputation: 389

Post » Tue Oct 11, 2016 7:32 pm

Everything you spawn is also on layer 0 with the background, and behind it in the z-order. Z-order shouldn't matter though, you should really be spawning objects on layer 1 or above, in front of the background. The objects you can see are not spawned and are already on layer 1 so they are visible in front of the background. Check your spawning events where it says layer 0 by default, you can update this to 1 or above.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Tue Oct 11, 2016 7:34 pm

The default layer 0 always has "Transparent" set to No. By moving a layer under it, you won't see it, unless you fix the values. Set Transparent to Yes on layer 1 and No on layer 0.
Also, it's best to spawn by layer Name, rather than number.
ImageImageImage
B
71
S
21
G
220
Posts: 3,648
Reputation: 123,725

Post » Wed Oct 12, 2016 7:13 am

Message: kab can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Thanks to both of you i have been able to add the background successfully but there is still an issue with the barrel...earlier the barrel will appear in front of monkey but now its appears behind it.I have already make sure that both are on Main layer and both monkey and barrel are at top of layer

Please have a look --> https://www.dropbox.com/s/fjey6g3m0pzi344/workingdemolatest-improved.capx?dl=0

Thanks a ton for your help thus far
B
5
S
1
Posts: 32
Reputation: 389

Post » Wed Oct 12, 2016 9:01 am

Event 13 you're still spawning on layer 0.
B
45
S
15
G
73
Posts: 2,006
Reputation: 43,394

Post » Wed Oct 12, 2016 9:24 am

Ahh missed that....Thanks a lot plinkie
B
5
S
1
Posts: 32
Reputation: 389


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 4 guests