Find the Best Demos and Examples

Check out this quick tour to find the best demos and examples for you, and to see how the Felgo SDK can help you to develop your next app or game!

Forums

OverviewFelgo 1 Support › How can I iterate through all the elements in an entity?

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • #7776

    Stan

    I would like to iterate through all the elements in an entity and print the x,y co-ordinates of the corners of all the elements on the screen. The way I was thinking of doing this is:

    1) iterate through all elements in entity

    2) For each element create a Text element with the co-ords of that elements in the text field

     

    Is there an easy way to do this?

    #7777

    Alex
    Felgo Team

    Hi Stan,

    just to be clear, do you want to

    • iterate through all child items of an entity, meaning it’s not entity specific, more like iterate through all child items of a parent item in general
    • or iterate through all entities of a specific entityType

    Cheers,
    Alex

    #7778

    Stan

    The first case 🙂

    #7779

    Alex
    Felgo Team

    You can just take <entityId>.children to get a standard JavaScript array of the child items.

    Cheers,
    Alex

Viewing 4 posts - 1 through 4 (of 4 total)

RSS feed for this thread

You must be logged in to reply to this topic.