How do I pin an object to something on a different layer?

Get help using Construct 2

Post » Thu Feb 02, 2017 9:31 pm

Situation: I want to pin/set the position of a sprite (=light effect) to the moon but the sprite has to be on the light layer to maintain it's light effect and the moon should obviously stay in the background aswell.

Problem: Now the problem is that the light layer has a different parallax scrolling than the background layer. Wich means that onscreen the light will never have the same position as the moon.


Layer order:
→Light Layer
→Main Layer
→Background Layer
B
6
Posts: 3
Reputation: 258

Post » Thu Feb 02, 2017 9:41 pm

Add a second light layer with the same parallax as the background layer.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Thu Feb 02, 2017 9:53 pm

The thing is, the Light Layer is just a black layer and the sprites have the blend mode effect "Destiniation out". So if I would make another layer the black of the light layer would still cover the moon in the background.
Sorry for the missing info!
B
6
Posts: 3
Reputation: 258

Post » Thu Feb 02, 2017 11:13 pm

Then set the current light layer with the same parallax as the background layer? Your problem is that you can't get the light on the light layer to match up with the moon's position right? It should work fine.

An example capx may help.
Mistakes were made.
B
53
S
27
G
114
Posts: 1,695
Reputation: 64,438

Post » Fri Feb 03, 2017 7:31 am

Your problem is that you can't get the light on the light layer to match up with the moon's position right?
Yes, exactly!

But the light layer should maintain it's parallax (100,100) since it also contains light effects for the mainlayer (100,100).
Background parallax (0,0)

Sorry for the late reply and thanks for your patience!
B
6
Posts: 3
Reputation: 258


Return to How do I....?

Who is online

Users browsing this forum: No registered users and 6 guests