Laurent's Forum Posts

  • 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

  • My project looks like the top of a desk with objects on it.

    Every object can be dragged to another place on the desk.

    Instead of the regular movement, I'd like to make the object move a more natural way.

    The idea is that when the object is draged it starts just a little bit to rotate around where it has been clicked and this rotation is related to the drag speed.

    I know this involves physics but I don't know how.

    Second question :

    One of my object is a container with many objects attached to it and everything needs to move together.

  • I've created a video player for an exhibition in a museum. The project is to be converted to .apk in order to be played on Android Tablet. I export to debug unsigned .apk sent to wifi to the tablet and thus I don't need to go via Play store.

    Everything is fine so far. the video plays correctly. Except for a function I added to spped up the video onward and backwards . The function works as when a sprite box on screen (for backward/forward) is taped, 2 seconds are added or substracted to playbacktime.

    This works great in preview mode and online but from the apk on tablet, Set Playbacktime function just restarts the video from the beginning.

    I've tried with ogv and WebM sources and they just don't show on screen. Mp4 seems to be the only format playable from apk.

    Any idea on how I can solve this ?

  • Hello,

    I'm building an app for a museum that mainly is a video player. I have 3 pages with one video on each. Videos can be up to 30 mb.

    The app is exported to .apk and installed on a Samsung tablet.

    Everything works fine except videos (preload is on) the time to launch, even if user comes back to a page where he already played a video. I thus guess Preload doesn't work as it should.

    How can I avoid this ?

    And if I can't, how can I get video preload status in order to show user the video is about to play ?

    Tagged: