|
Smolgui
Immediate gui library based on SFML
|
load and hold resources of all kind (image, music, etc.), that can be retrieved with Identifier that are comparable. Note that Resource should implement a "bool loadFromFile" function for this holder to work. sf::Font use openFromFile, but it's handled with type test. More...
#include <ResourcesHolder.h>
Public Member Functions | |
| template<typename... Parameters> | |
| bool | load (const Identifier &id, const std::string &filename, Parameters &&... args) |
| load resource from file. Note that for TextContainer or GuiLayout, you can store resource in several files and call load with the same id but different files name. | |
| template<typename... Parameters> | |
| bool | reload (const Identifier &id, Parameters &&... args) |
| reload resource from file (will not work if load was not called before) | |
| const Resource & | get (const Identifier &id) const |
| get resource from its identifier, return first element if id was not registered | |
| Resource & | get (const Identifier &id) |
| get mutable resource from its identifier, return first element if id was not registered | |
load and hold resources of all kind (image, music, etc.), that can be retrieved with Identifier that are comparable. Note that Resource should implement a "bool loadFromFile" function for this holder to work. sf::Font use openFromFile, but it's handled with type test.
| Resource & sgui::ResourcesHolder< Resource, Identifier >::get | ( | const Identifier & | id | ) |
get mutable resource from its identifier, return first element if id was not registered
| const Resource & sgui::ResourcesHolder< Resource, Identifier >::get | ( | const Identifier & | id | ) | const |
get resource from its identifier, return first element if id was not registered
| bool sgui::ResourcesHolder< Resource, Identifier >::load | ( | const Identifier & | id, |
| const std::string & | filename, | ||
| Parameters &&... | args ) |
load resource from file. Note that for TextContainer or GuiLayout, you can store resource in several files and call load with the same id but different files name.
| bool sgui::ResourcesHolder< Resource, Identifier >::reload | ( | const Identifier & | id, |
| Parameters &&... | args ) |
reload resource from file (will not work if load was not called before)