Added extra constructor to Texture to support passing std::string to Picture::create

0.8
Bruno Van de Velde 2017-01-18 22:09:28 +01:00
parent c94944bf10
commit 3e3e04089e
1 changed files with 18 additions and 0 deletions

View File

@ -67,6 +67,24 @@ namespace tgui
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Constructor that created the texture
///
/// @param id Id for the the image to load (for the default loader, the id is the filename)
/// @param partRect Load only part of the image. Pass an empty rectangle if you want to load the full image
/// @param middlePart Choose the middle part of the image for 9-slice scaling (relative to the part defined by partRect)
///
/// This constructor just calls the corresponding load function.
///
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
Texture(std::string id,
const sf::IntRect& partRect = sf::IntRect(0, 0, 0, 0),
const sf::IntRect& middlePart = sf::IntRect(0, 0, 0, 0))
: Texture(sf::String{id}, partRect, middlePart)
{
}
/////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////
/// @brief Constructor that created the texture
///