Parallaxed coordinates vs unparallaxed

0 favourites
  • 6 posts
From the Asset Store
Set of 10 Parallax Background to make pixel art game.
  • Hi

    Is there any possibility to get the objects coordinates - object is on heavy parallaxed layer and compare it with coordinates of unparallaxed object?

    How does parallax parameters exactly influence coordinates in regard of unparallaxed values?

    For example I would like to know the distance between (scrollx, scrolly [let's assume it's center of the window])which is unparallaxed and (objectx, objecty)on parallaxed layer.

    Object is a lightstreak and I want to create lens flare effect, which depends on its position regarding window's center...

  • Just add the layername or layernumber after the object.x

    So object.x(0) will get the object's coordinates on layer 0

    and object.x(1) will get the object's coordinates on layer 1

    If one of the layers is paralaxed or zoomed these results will therefor be different.

    Edit: I know this works for mouse and touch coordinates, so I assume it works for objects as well..

  • LittleStain - that only works for mouse and touch positions, not ordinary objects.

    Object positions are not affected by parallax at all, just where they are drawn. So the object position will be identical on all layers, even when different parallax settings are used.

  • Thanks Ashley for correcting me.

    I wasn't sure about that, so I added the edit-comment.

  • Thanks Ashley, thanks LittleStain

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • So how would one do this then?

    I'd like to get the Parallaxed coordinates... so in essence, where it's actually drawn on the screen..

    I'm making a minimap and I have some background objects that use parallax 25,25.. I'd like them represented on the minimap.. but they don't line up because of the parallax delay.

    any suggestions LittleStain ?

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)