How do I create a composite object for usage?

0 favourites
  • 4 posts
From the Asset Store
Fully commented source code/event sheet & sprites to create a space shooter game
  • I want to create a UI item, that contains different items for selection and pops-up just above the cell that was tapped on.

    The items for selection never change, so I would prefer to just arrange the menu in the layout and then move it just above the cell and out of sight again when a cell is tapped. However, for that to work, I would need a kind of composite object (the menu), that contains the other objects and the positions of the objects inside have to be relative to the containers position.

    I think it should work, since it does in most engines, but I haven't found how to hierarchically structure objects into each other.

    Any possibility for such in construct 3?

    Tagged:

  • Scene Graph (hierarchy) is what you are looking for.

    Create hierarchy connections between all objects in the layout editor. Select two or more objects, right-click on the parent and choose "Add selection to this instance"

    Then, when you need to spawn this composite object in runtime, create the parent object with "Create hierarchy=yes" option.

    If the object is already on the layout, you can move it anywhere and all child objects will move with it.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • Is it possible to also only have one child-object? I've read in a few posts, that it's necessary to put tower sprites in a child object, if you don't want them to rotate with the tower.

  • Not sure what you mean. Of course it's possible to only have one child object.

    And you can choose which parameters will be synced with the parent - for example if you don't want to rotate the child with the parent, disable "Angle" checkbox.

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