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);