Absolute X and layer.X

Get help using Construct 2

Post » Sat May 04, 2013 1:09 am

I am struggling with this one,

I have a layout that is using parallax layers all moving at different scroll rates, and an object that moves from layer 0 through to layer 7..

the problem is that as it changes layer it maintains it's x, but the layers x is offset due to the parallax scroll, causing a visible shift, so I need to place the object, and move the object to an absolute x that is indifferent to the layers scroll rate, is this possible?...

thanks.Pixel perfick2013-05-04 01:13:14
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Sat May 04, 2013 1:46 am

you could put another layer where you want it to appear with the same layer parallax
c|;-)>---sosensible2013-05-04 01:47:06
B
39
S
10
G
7
Posts: 514
Reputation: 9,426

Post » Sat May 04, 2013 2:01 am

Yes, but I would have the same problem with that layer...and ultimately all the layers would have the same scroll rate...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Sat May 04, 2013 3:13 am

I use "layer(0).x" for example, where '0' is the number of the layer. I always keep that layer's scale etc. the same so it will always work well.
B
27
S
8
G
5
Posts: 429
Reputation: 6,902

Post » Sat May 04, 2013 12:01 pm

@tobye Thanks, I will try that later...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Sun May 05, 2013 12:11 am

This is still not working for me, I still need a way to either calculate or reference an absolute X,Y position, from any given layer despite positive or negative layer offset...help, please...
As long as I can move left, right and fire, I'm Happy...
B
42
S
15
G
11
Posts: 655
Reputation: 12,260

Post » Sun May 05, 2013 4:42 am

sounds like a pretty awkward problem, but you can find coordinates of objects' positions on any layer using layertocanvasX/Y and canvastolayerX/Y expressions.
Unfortunately there is no direct LayertoLayerX/Y to make it easier, but it's a start at least.

anyway, you'll see them listed in the expressions panel, and the manual will do a better job at explaining than me
B
28
S
8
G
1
Posts: 469
Reputation: 4,683


Return to How do I....?

Who is online

Users browsing this forum: selaus and 0 guests