Laurent's Forum Posts

  • 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 :)

  • In my game, an object has the DragNDrop behaviour. To adapt how other sprites around behave, I need to know the direction the drag is going.

    How can I do that ?

    Tagged:

  • My game is base on TileMovement and there is a case where a sprite can move in diagonal, ie Up then Left. I use Simulate to give movement to the sprite. Simulate up, down, right, left is ok but when I tell the Sprite to go Up then Right, only the first command is applied.

    Is there a way to make this work ?

  • Do you create an Element instance in runtime? Did you tick "Create hierarchy" checkbox? Also check which properties the child objects are syncing with the parent (on the properties panel).

    I'm using the method you described heavily in my project and it definitely works.

    Thanks for your tips ! It works now :)

  • Have you tried the latest beta? They are doing a lot of work on Hierarchy, things like persist and Json are involved.

    yours

    winkr7

    Hello,

    Thanks for your answer :)

    Actually I did but I don't see anything changed

  • Id like to use a layout as a repository to design and store all of my complex game items. They are made of an Element sprite with a container filled with Objects sprites also connected to the Element through Hierarchy. Thus Element is parent to Objects.

    When I drag an Element in another layout, I see in the debugger that every Objects are correctly added runtime, put into the right container but everything acts as if hierarchy was broken.

    Am I missing something ?

    Edit :

    I managed to reinstore hierarchy using a test when layout is stored :

    On layout start > for each Element > pick Object where Object.ParentName = Element.Name > add child Object to Element

    It seems to me a bit complicated and I'm sure there's a better way to do this.

    Also, in new layout where just Element is dropped, Objects don't keep their position relative to Element that they have in Repository layout and are all created at Point.0

  • Another option is to add all these array into a family. Then you could pick family instance by name, using this condition:

    System Pick ArrayFamily by evaluate: ArrayFamily.ObjectTypeName=nameVar

    .

    You can also use a single array object with several instances - just like you do with sprites. Each instance will store strings for one language. Define an instance variable "lang" on the array and pick array instance by variable value.

    Hello dop2000,

    Actually, I'm updating your video subtitles template and try two approches :

    - use one and unique array and add to it a line for each different language.

    - use a array for each language

    I choosed the second one.

    It works perfectly, but I'm sure the way I did it is absolutly not optimised : I didn't manage to create just one SubtitleParse function and had to duplicate it 3 times for each of my 3 langages. I did the same for the Show Subtitles routine. For example in the following screencap, is the parse routine for French Language. With the red line in front, Arrays I would like to be able to pick for each language.

    My solution works, even if it is not optimized. I'll at yours :) it's a great lesson. Thanks

  • Hello

    In my game I'm using multiple arrays and I want to have them all processed with a single function.

    Here's hat I have for example :

    I have to process arrays named :

    - SubsArrayfr

    - SubsArrayBzh

    - SubsarrayEn

    In the expression, is there a way to replace "SubsArrayFr" by something like "SubsArray"&Variable, where Variable can be Fr, Bzh or En ?

    Tagged:

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Thanks DiegoM, that would be great to add this and also have complete video control from timeline, including preview

  • Hi DiegoM

    I'm still on the project and try to make sprite position more accurate.

    I tried many ways to forward the video by adding 0.02 second to the playbacktime. It works when the video runs but I also would like to pause the video and forward it from still image to still image. Are there limitations that prevent this ? Do you have a solution ?

  • Done