parallax (?) and positioning problem

Get help using Construct 2

Post » Thu Jul 23, 2015 10:50 am

Hi,

My "playerSprite" is on "player" layer, parallax (100,100). My "background" layer is set on parallax (100,0).

When I try to create an object from my "playerSprite" position on "player" layer, it works as it's expected.

When I try to create an object from my "playerSprite" position on "background" layer, the object is no created on the actual position of my "playerSprite". It's created above on the Y axis.

Is it normal? If yes, how can I deal with this situation?

Thanks for reading
B
7
S
1
Posts: 64
Reputation: 585

Post » Thu Jul 23, 2015 11:22 am

yes this is expected behaviour..

To get around this there are the expressions:

CanvasToLayerX(layer, x, y)
CanvasToLayerY(layer, x, y)
Calculate the layout co-ordinates underneath a position in canvas co-ordinates for a given layer.

LayerToCanvasX(layer, x, y)
LayerToCanvasY(layer, x, y)
Calculate the canvas co-ordinates above a position in layout co-ordinates for a given layer.
I told my dentist I had trouble with my teeth and asked her to fix it without looking in my mouth..
B
54
S
16
G
8
Posts: 6,160
Reputation: 19,775

Post » Thu Jul 23, 2015 12:32 pm

Where do I have to put these expressions?

The action "create object" have three different text fields, and the expressions that you give me include all parameters.
B
7
S
1
Posts: 64
Reputation: 585

Post » Thu Jul 23, 2015 12:54 pm

B
15
S
6
Posts: 105
Reputation: 1,356

Post » Fri Jul 24, 2015 9:02 am

Nice!

Thank you for help guys
B
7
S
1
Posts: 64
Reputation: 585


Return to How do I....?

Who is online

Users browsing this forum: Ryan Kocourek and 12 guests