Containers of objects which are on different Layers

This forum is currently in read-only mode.
From the Asset Store
Adjusting the game screen for different resolutions (Letterbox scale)
  • For example, I have a container with 2 sprites. Each sprite belongs to a different layer on the layout.

    If I place (using the GUI, not with events) 1 of the sprites on the layout, is the other sprite supposed to be created automatically? If yes, which layer will it be on?

    Is it a bad idea to have containers with objects which are on different layers?

    From what I've seen, 1 sprite may be "dragged" into the other sprite's layer. The behaviour seems quite erratic (isn't fixed or well-defined). Is there a smart way to go about doing this? I want to make sure that the objects are always fixed on their own layers (where they are supposed to be), but yet I want the container to be maintained.

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • As far as I am aware of, the objects in a container will be created on the same layer. However, something like this should work:

    + Sprite: [negated] Sprite: Is on layer "layername"
    -> Sprite: Move to layer "layername"[/code:2gv6o1bc]
    When using this, the sprites will only be on the wrong layer for one tick (the one, where they are created)
  • You would be better off having all the objects in the container destroyed on start, and then create one part of the container at start of layout.

    Since everything in a container is created if one is, and all contained objects are also picked you could simply tell the specific object what layer to go to.... all in the start of layout event.

    Then the only reason it would go to another layer is if you tell it to.

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