asset::AssetLoader
#include <AssetLoader.hpp>
Public Functions
~AssetLoader() =default
template <class... Args> void
LoadTexture(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
void
LoadTexture(const std::string & key, std::vector< std::string > paths)
template <class... Args> void
LoadBGM(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.
void
LoadBGM(const std::string & key, std::vector< std::string > paths)
template <class... Args> void
LoadSFX(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.
void
LoadSFX(const std::string & key, std::vector< std::string > paths)
template <class... Args> void
LoadFont(const std::string & key, const std::filesystem::path & path, std::string_view next, Args... args) load a font and add it to the map
void
LoadFont(const std::string & key, std::vector< std::string > paths)
void
loadKeybind(const std::string & action, const std::string & key)
std::filesystem::path
smartPath(std::vector< std::string > paths) create a smartpath from a vector of string
sf::Texture &
GetTexture(const std::string & key) Get an Asset object from the map.
sf::Music &
GetBGM(const std::string & key) Get a background music object from the map.
sf::Sound &
GetSFX(const std::string & key) Get a sound effect object from the map.
sf::Font &
GetFont(const std::string & key) Get a font object from the mapb.
sf::Keyboard::Key &
GetKeybind(const std::string & key)
void
LoadIniFile(const std::filesystem::path & path) Load a .ini file with boost loading assets into the map.
std::filesystem::path
smartPath(std::filesystem::path path)
template <class... Args> std::filesystem::path
smartPath(std::filesystem::path path, std::string_view next, Args... args)
void
Detailed Description
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
Public Functions Documentation
function ~AssetLoader
Destroy the AssetLoader object
function LoadTexture
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
function LoadTexture
function LoadBGM
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
function LoadBGM
function LoadSFX
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
function LoadSFX
function LoadFont
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
function LoadFont
function loadKeybind
function smartPath
create a smartpath from a vector of string
function GetTexture
Get an Asset object from the map.
Parameters:
key of the asset to get
Return: sf::Texture& the texture
function GetBGM
Get a background music object from the map.
Parameters:
key of the asset to get
Return: sf::Music& the music
function GetSFX
Get a sound effect object from the map.
Parameters:
key of the asset to get
Return: sf::Sound& the sound effect
function GetFont
Get a font object from the mapb.
Parameters:
key of the asset to get
Return: sf::Font& the font
function GetKeybind
function LoadIniFile
Load a .ini file with boost loading assets into the map.
function getInstance
the instance of the AssetLoader object
function smartPath
function smartPath
function display_key_from_map
Updated on 2022-11-13 at 17:21:37 +0100
Last updated