How do I find all the objects on a layer?

This forum is currently in read-only mode.
From the Asset Store
Welcome! I-Spy (Hidden objects) is an educational puzzle that is more than just seek-and-find activities.
  • I am trying to use the SDK to find all the objects (of any type) on a given layer.

    Any tips on how to do this would be appreciated.

  • You can do this by grouping objects using Families. SciDave does a great job explaining how to use Families in his Mikey's Adventure tutorial, which can be found here:

    It's the tutorial I'm currently reading. He also talks about the integral parts of any game, including HUDs and events, among other things.

    If you mean see a group of objects highlighted or something similar while on a particular layout, I'm not sure there is something like that just yet. People correct me if I'm wrong. <img src="smileys/smiley1.gif" border="0" align="middle" />

  • Try Construct 3

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

    Try Now Construct 3 users don't see these ads
  • don't have time to test this at the moment, but I would say you have to use pRuntime->GetTypes(...) and then pRuntime->GetTypeInstances(...) for each of the types you get

    then loop through the instances and check instance->info.layer, or pRuntime->GetObjectLayer(...)

    against the desired layer and put each matching object in a vector or list

  • lucid, thanks! That is what I was looking for. It's not the most intuitive, but it gets the job done.

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