Ezelia / EZGUI

EZGUI - The missing GUI for Pixi.js and Phaser.io

Home Page:http://ezgui.ezelia.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Way to iterate through child Components (primarily, of List)?

Shadowstep33 opened this issue · comments

Hi, particularly if I define a list - is there a way to iterate through the components that are added to it? I notice if I look in it's children, there are a couple miscellaneous things but it seems the child at index 2 is a container that has the components of the list I'm looking for. But iterating through it seems to produce some unintended results. Currently, what I am doing is this:

    for(var c in EZGUI.components.playerBagList.children[2].children){
        if(!(EZGUI.components.playerBagList.children[2].children[c] instanceof Button))
            continue;

... //All further actions (such as handlers) are done on EZGUI.components[EZGUI.components.playerBagList.children[2].children[c].guiID]

//Perhaps EZGUI.components.playerBagList.components? 
        }

this is suitable but seems like a bit of a long winded way to do it (not to mention if I ever change the order of playerBagList's children things will get weird). Perhaps I am just being lazy... lol

Anyways, love the library so far!