How do I set a tiled background to the width of another?

Get help using Construct 2

Post » Sun Dec 28, 2014 12:25 am

Hey Construct Community,

I'm using a tiled background as the ground for my auto-runner, but I would like to put a grass sprite on top of the ground, which is also a tiled background. I've created a container so whenever the ground is created, the grass is as well. However, I'm having trouble setting the grass to the width of the ground and to the top of the ground.
B
24
S
5
G
1
Posts: 153
Reputation: 2,088

Post » Sun Dec 28, 2014 4:51 am

Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 29, 2014 12:15 am

@TiAm That's exactly what I've been trying to do, thank you! I implemented your code but it isn't working with the procedural generated platforms. I attached the .capx if you wanted to take a look.

runner_bugged.capx
You do not have the required permissions to view the files attached to this post.
B
24
S
5
G
1
Posts: 153
Reputation: 2,088

Post » Mon Dec 29, 2014 1:49 am

Here, check out this capx:

https://www.dropbox.com/s/q2dr73anahz7f ... .capx?dl=0

I switched the grass from a tiledBG to a 9patch. The principle is the same though.
Don't lose your work. Backup your game with Dropbox.
B
44
S
10
G
10
Posts: 1,106
Reputation: 9,202

Post » Mon Dec 29, 2014 2:42 am

Thanks! I've never even heard of the .Bbox function or 9patch, just shows how much I still have to learn about Construct 2.

I don't think the grass is destroying like the ground is though, the ends can be seen on the left of the screen. Maybe because it's still pinned to the original position of the ground before it's destroyed?
B
24
S
5
G
1
Posts: 153
Reputation: 2,088


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 19 guests