Page 1 of 1

Help with Iter

Posted: Thu Feb 11, 2021 22:08
by orion
Hi Guys,

i'm sure ive overlooked something but i'm not sure what :(

previously i would

Code: Select all

        // get ptr to named imageset - don't forget this throws if imageset is not present
   CEGUI::Imageset& imageset = CEGUI::ImagesetManager::getSingleton().get( "pics" );

        ItemListbox* Pics_names = static_cast<ItemListbox*>(winMgr.getWindow( "Pics_names"));

        Editbox* pics_txt = static_cast<Editbox*>(winMgr.getWindow( "pics_txt"));

        imageset.getName();

    // get iterator to iterate over defined images.
        Imageset::ImageIterator iter = imageset.getIterator();

    while ( !iter.isAtEnd() )
    {


to scan though an image set etc,etc

now imageset has been removed so tried

Code: Select all

CEGUI::Image& imageset = CEGUI::ImageManager::getSingleton().get("pics");
imageset.getName();
// get iterator to iterate over defined images.
      ImageManager::ImageIterator iter = imageset.getIterator();


but getiterator is not part of the image class

so what would be the way to go here ?

Re: Help with Iter

Posted: Mon Feb 22, 2021 20:06
by orion
in case its not that clear what i wanted to do

i just need to grab the names of every images in an imageset
so i can can then select a diffrent image

Re: Help with Iter

Posted: Wed Jan 19, 2022 08:23
by niello
Hi.

Here is a quick solution I've found. It is for iterating all available images, and an imageset name is the first part of the image name, ending at "/". There likely is an iterator for images in a particular imageset but I don't know about it.

Code: Select all

    auto it = CEGUI::ImageManager::getSingleton().getIterator();
    while (!it.isAtEnd())
    {
        auto name = it.getCurrentKey();
        ++it;
    }