Laurent's Recent Forum Activity

  • You can cheat the scroll to plugin by attaching it to a dummy sprite A that will be screen centered and then position according to this sprite A the sprite B you want to be centered to your window.

  • I have to thank you very much for pointing me into the Hierarchy direction. I haven't paid attention to it so far and I discovered a whole new world.

    Thank you ! Now it works

    For anyone interested, here's a commented project file

    https://www.dropbox.com/s/hkw9g396zrnw5ha/DragAnimationLevels.c3p?dl=0

  • I had a long look at hierarchy and yes, it looks like very powerful and useful feature.

    According to the drawing I posted before, let's say that Blue square and Yellow square are part of a family called Square and every sprite children's name would be the number/letter they have (so Sprite.A, Sprite.B, Sprite.1, Sprite.2) . Would your previous code be :

    -For each Square

    Parent pick all Child : Child move in front of Square

    I found Child "Parent pick all Child" condition but not "Child move in front" action

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Got it. But how do I do if I have many children attached to the main object of a container and many container (that don't share the same objects)

    Here's a quick sketch of how it looks like

  • When changing z-order or moving to another layer, you need to do this for each object in the "container".

    If you need to do this often, you can make an event which moves all child objects above the parent object on every tick. Also I suggest using hierarchy instead of pin.

    > For each Parent
    Parent pick all Child : Child move in front of Parent
    

    Thank you !

    Actually, I've to do it quite often with many different containers.

    I tried your method but couldn't find the action "Child move in front of Parent"

  • My game has an object container made of 3 sprites. Basically, it's a big sprite with two sprites pined on it acting as buttons.

    At certain times of the game, when clicked, I need the object to :

    1) move in front of other objects on the scene

    2) move to another layer.

    So I send the commands to the main element of the container and find out that

    1) only the main element is send in front

    2) only the main element is sent to the other layer

    I thought that when an order was sent to the main element of the container, the whole container would act accordingly to and behave as a single object. ie, when main element is sent to front, all the object elements would be sent to front and be rearranged. The same when the main element is sent to another layer. All the elements would follow and be put at the right place and zindex.

    Is there a simple way to fix this ?

    Tagged:

  • You do not have permission to view this post

  • Lovely ! It works ! Thank you !

  • Thank you very much for your solution !

    Actually, I'm almost there !

    I gave up the idea of rotating around touch point.

    And now, I've got the perfect type of movement I needed.

    One thing I couldn't fix so far is to have dragged element come in front of the rest of the scene

    Code is here

    https://www.dropbox.com/s/ovrvhtt7gfbwijo/TestDrag2%20copie.c3p?dl=0

  • Not really, I'm trying to recreate the interactivity like in this video (starting 0:30) youtube.com/watch

    But with a more natural move. In the video, pictures appear to float in the air. I'd like them to behave in a more static way (with just a little inertia) to make them act as if they were on a wooden desk.

    Also, i need them to come on top of the pile when clicked (not in an animated way though), considering every photo are a container made from different sprites with interactivity.

    I managed to find and embryo of solution by rotating the sprite in the drag direction. But there are to problems still :

    - movement is too jerky

    - rotation applies to image point, not to point where object is touched

    File is here

    https://www.dropbox.com/s/h3ageq37xyvnzpq/TestDrag2.c3p?dl=0

    Imagine sprite has 3 image points, would it be possible to use the point nearest to touch to apply the rotation to ?

    There's a topic about this exactly also

    construct.net/en/forum/construct-3/how-do-i-8/add-physics-dragdrop-166346

  • If you are planning to use Physics, here is a simple example:

    https://howtoconstructdemos.com/throw-a-physics-object/

    Dragging a container object may be tricky. You can try attaching objects with pin for dragging, and then un-pin and re-connect them using Physics joints. But this may require a lot of trial and error.

    Thank you ! I had a look at your example before but saw that sprite doesn't move when it is picked.

    I understand container is tricky. I already have a problem with changing Z index of all of its element. When I change the z index of the main element, the other elements of the group.

    Very strange...

    https://www.dropbox.com/s/7ckmwu6xzx1x62n/TestDrag.c3p?dl=0

Laurent's avatar

Laurent

Early Adopter

Member since 18 Jan, 2012

Twitter
Laurent has 1 followers

Trophy Case

  • 14-Year Club
  • Forum Contributor Made 100 posts in the forums
  • Forum Patron Made 500 posts in the forums
  • Regular Visitor Visited Construct.net 7 days in a row
  • RTFM Read the fabulous manual
  • Email Verified

Progress

19/44
How to earn trophies