How do I Group Objects (Mixed) and Move?

0 favourites
  • 11 posts
From the Asset Store
322 audio files (.wav and mp3) with everything you need for your MMA project.
  • Hello,

    Lets say, for example, I have a large sprite of a dialog box. Placed on the dialog box spite is also text, and two buttons.

    If I dynamically move the dialog box in an event, none of it's components will move with it (text and two buttons) as they're not grouped.

    I could, in the events on every tick tell the buttons and text to have the same positions as the dialog box with offset, but that just seems way too much work for something so simple! (What if I change the scale too?)

    I could also add a 'Pin' component to the text and buttons, however this doesn't seem to work very well? If I were to reset the X position on the dialog box for example - the pinned elements will not follow respectably (bug?).

    I found out that you can group objects together, and this is called 'Families' however, this is only for objects of the same type, which doesn't work for me.

    I find it very odd that something so common to game development, or just general development for that matter, doesn't seem to exists on a widely used editor... Grouping?

    Can someone please point me in the right direction? Thanks.

  • scirra.com/manual/150/containers

    Thanks, however this doesn't explain how I move 'grouped' objects. If I add the buttons and text to the dialog box container - it still does not follow the dialog box respectably.

  • Based on what you said above, it sounds like you pinned backwards. Pin the other items to the dialog box and move the dialog box. That should work just fine.

  • Based on what you said above, it sounds like you pinned backwards. Pin the other items to the dialog box and move the dialog box. That should work just fine.

    I've added the Pin behaviour to my Text, and then on my event sheet: Every tick > Text_0 > Pin to > Dialog Box

    Still doesn't follow my dialog box - Its worth noting that my dialog bot is being moved by LiteTween, would this affect the Pin Behaviour?

    Thanks.

  • Okay, after checking out the example on Pin Behaviour, I changed the 'Every tick' to 'On start layout' and the Pin works fine.

    However, the pin doesn't take into account the size of the object I'm wanting to pin. The dialog box 'pops' up from a 0% scale to a 100% scale tween. How can I get the other objects (buttons and text) to follow?

    Thanks.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • You can use Sprite or text set position to another object at every tick system

  • Not sure, but i'd try this (propably not best practice):

    1. Put your effect code in a function, since you want it to work more than one object.

    2. Put your objects in a object family

    3. Run your function on each family member and hand over your UID.

    4. Pick your object by UID from the function parameter.

  • How are you doing the scaling now, specifically, in LiteTween?

  • How are you doing the scaling now, specifically, in LiteTween?

    Yes, using LiteTween : Create/Initialise tween : [Tween Property] Size (Pixel) > Start from the beginning.

    Thanks.

  • Can you post a CAPX?

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