Laurent's Forum Posts

  • My sprites are part of the same family. I'd like to organise them on the Z order so that the smallest sprites in size are at the top and the bigger at the bottom.

    I guess a "for each" loop is involved but don't exactly know how to set it up

    Tagged:

  • Thank you all for your suggestions.

    Giving the same name to the objects in the family sounds like a good idea !

  • When you write action, you mean one action per object in the form of :

    - create Object 1 at X,Y

    - creaste Object 2 at x,Y

    etc, as many lines as there are objects ?

    No way to make a batch create function ?

  • To create each object in a family you need to make a create action for each object. Alternatively you could place them in the layout yourself to avoid making the events.

    is it not possible to have something like :

    - for each object in family

    - create object on layer 0 at x=150, y=150

    I've quite a lot of object in the family and would like to automatize the creating process to save time and have a simple method if I have to make changes (for example the coordinates)

  • My game is an empty scene when layout starts.

    All my objects to be displayed are in a family and they re a lot.

    At start of layout, how do I tell Construct to look into Family and create each object at the centre of the layout(x=layoutWidth/2, y=layoutheight/2) ?

    Tagged:

  • Thank you !

    Construct is full of subtilities :)

  • Amazing !

    thanks for confirming this intuition :)

    (the subfolder trick doesn't work, though)

  • In my project, I use Ajax request a lot, but according to player choice, the requested project file is always different.

    In the following expression, how can I use a variable instead of testFr.srt filename ? For example, filename could be testFr1.srt or testFr2.srt...

    -> AJAX: Request testFr.srt (tag "subFr")

    Can I use Request URL instead ? And if yes, what would be the adress to a project file named testFr.srt

    Tagged:

  • What would be the best screen size to develop a webapp with if I want to fit most of the phones on the market with ?

  • Quite right.

    This works :)

    Now, when scaling one family element, disable touch to other elements

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • I added a drag function to the Family but there seem to have conflict between drag touch and touch used for rescale. Any idea on how to fix this ?

  • OK, I managed to have it work with elements and adapt it to my project. Thats wonderful ! Thank you very much.

    Here is the file if it can be useful to anyone.

    dropbox.com/s/tsu1unckxdinog2/Zoom%20an%20element.c3p

  • I have this old demo:

    https://howtoconstructdemos.com/zoom-a-sprite-or-entire-screen-with-pinch-touch-gesture/

    I believe I've also seen an official example for zooming with pinch.

    Thank you ! that's interesting indeed !! I see your example relies a lot on UID but I need to be able to apply this to the elements of a family and families don't have UID. Is there a workaround ?

  • My game for a multitouch board has different elements on the screen acting like documents on a desk. I'm looking for a way to scale the object by pinching them with two fingers.

    I've the intuition I have 1) to record two touch points when object is touched, 2) record their distance when both touches occur and 3)monitor their distance change when they are in touch and send this relative change to the object.

    OK but how do I program this ?

    Tagged:

  • Create two instance variable for the object and set them while dragging: prevX and prevY. Set up an event to check before you update the variables.

    So something like:

    Object Is dragging

    1) if object.prevX < object.X then you know the object has moved to the right, etc.

    2) set object.prevX to object.X

    You have to do the comparison before you update the variables, otherwise prevX and X will be the same.

    Woaw, thank you :)