asset::AssetLoader
Last updated
Last updated
#include <AssetLoader.hpp>
template <class... Args> void
void
template <class... Args> void
void
template <class... Args> void
void
template <class... Args> void
void
void
std::filesystem::path
sf::Texture &
sf::Music &
sf::Sound &
sf::Font &
sf::Keyboard::Key &
void
std::filesystem::path
template <class... Args> std::filesystem::path
void
This class loads all the assets neened by the game and stores them in a map Basic operatations on assets are supported An asset is either a texture, a sound or a font
load an SFML asset and add it to the map
Parameters:
key the key to load the asset
path first segment of the path of the asset
next next segment of the path of the asset
args other segments of the path
Load a background music and add it to the map.
Parameters:
key the key to load the asset
path first segment of the path of the asset
next next segment of the path of the asset
args other segments of the path
Template Parameters:
Args Path segments
Load a sound effect and add it to the map.
Parameters:
key the key to load the asset
path first segment of the path of the asset
next next segment of the path of the asset
args other segments of the path
Template Parameters:
Args Path segments
load a font and add it to the map
Parameters:
key the key to load the font
path first segment of the path of the font
next next segment of the path of the font
args other segments of the path
create a smartpath from a vector of string
Get an Asset object from the map.
Parameters:
key of the asset to get
Return: sf::Texture& the texture
Get a background music object from the map.
Parameters:
key of the asset to get
Return: sf::Music& the music
Get a sound effect object from the map.
Parameters:
key of the asset to get
Return: sf::Sound& the sound effect
Get a font object from the mapb.
Parameters:
key of the asset to get
Return: sf::Font& the font
Load a .ini file with boost loading assets into the map.
Updated on 2022-11-13 at 17:21:37 +0100
() =default
(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) load an SFML asset and add it to the map
(const std::string & key, std::vector< std::string > paths)
(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) Load a background music and add it to the map.
(const std::string & key, std::vector< std::string > paths)
(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) Load a sound effect and add it to the map.
(const std::string & key, std::vector< std::string > paths)
(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) load a font and add it to the map
(const std::string & key, std::vector< std::string > paths)
(const std::string & action, const std::string & key)
(std::vector< std::string > paths) create a smartpath from a vector of string
(const std::string & key) Get an Asset object from the map.
(const std::string & key) Get a background music object from the map.
(const std::string & key) Get a sound effect object from the map.
(const std::string & key) Get a font object from the mapb.
(const std::string & key)
(const std::filesystem::path & path) Load a .ini file with boost loading assets into the map.
&
()
(std::filesystem::path path)
(std::filesystem::path path, std::string_view next, Args... args)
()
Destroy the object
the instance of the object