void WitchBlastGame::write(std::string str, int size, float x, float y, int align, sf::Color color, sf::RenderTarget* app, int xShadow, int yShadow, int maxWidth)
while (myText.getLocalBounds().width > maxWidth && size > 5)
{
size--;
myText.setCharacterSize(size);
}
}
float xFont = x;
if (align == ALIGN_CENTER)
xFont = x - myText.getLocalBounds().width / 2;
else if (align == ALIGN_RIGHT)
xFont = x - myText.getLocalBounds().width;
if (xShadow != 0 && yShadow != 0)
{
myText.setPosition(xFont + xShadow, y + yShadow);
myText.setColor(sf::Color(0, 0, 0, 255));
app->draw(myText);
}
myText.setPosition(xFont, y);
myText.setColor(color);
app->draw(myText);
}
void WitchBlastGame::writeGraphic(std::string str, int size, float x, float y, int align, sf::Color color, sf::RenderTarget* app, int xShadow, int yShadow, int maxWidth)
{
if (parameters.language == 4) // russian
{
write(str, size, x, y, align, color, app, xShadow, yShadow, maxWidth);
}
else
{
myText.setFont(graphicsFont);
write(str, size, x, y, align, color, app, xShadow, yShadow, maxWidth);
* \param align : alignment (ALIGN_LEFT, ALIGN_CENTER or ALIGN_RIGHT)
* \param color : color of the string
* \param app : the rendering target
* \param xShadow : offset of the shadow (x)
* \param yShadow : offset of the shadow (y)
* \param maxWidth : max width of the text image (0 = no limit)
*/
void write(std::string str, int size, float x, float y, int align, sf::Color color, sf::RenderTarget* app, int xShadow = 0, int yShadow = 0, int maxWidth = 0);
void writeGraphic(std::string str, int size, float x, float y, int align, sf::Color color, sf::RenderTarget* app, int xShadow = 0, int yShadow = 0, int maxWidth = 0);
/*!
* \brief Save the game
* Save the game to file : complete floor and maps, items and blood position, player current equipment and stats....
*/
void saveGame(bool autosave);
/*!
* \brief Load the game
* Load the game from file. After restoring the game, the file is destroy.
* \return true if succeeded
*/
bool loadGame();
/*!
* \brief Save the game data (general)
*/
void saveGameData();
/*!
* \brief Load the game data (general)
*/
void loadGameData();
/*!
* \brief Load the savegame data
* \return the savegame data
*/
saveHeaderStruct loadGameHeader();
/*!
* \brief Returns a random equip object
*
* Returns a random equip object (not an object the player already possesses) .