// Jason Brillante "Damdoshi"
// Hanged Bunny Studio 2014-2015
//
// Sewer Glue

#include		"SewerGlue.hpp"
#include		"Menu.hpp"

void			hbs::Menu::Text(sf::RenderTarget	&screen,
					const std::string	&str,
					int			x,
					int			y,
					int			color)
{
  int			xp = x;
  unsigned int		i;

  for (i = 0; i < str.size(); ++i)
    {
      sprites[FONT].setTextureRect(sf::IntRect(str[i] * 5, 0, 5, 7));
      sprites[FONT].setPosition(xp, y);
      if (color == 1)
	sprites[FONT].setColor(sg->vic20palette[rand() % 16]);
      else if (color == 0)
	sprites[FONT].setColor(sf::Color::White);
      else if (color == -1)
	sprites[FONT].setColor(sf::Color::Black);
      screen.draw(sprites[FONT]);
      xp += sprites[FONT].getGlobalBounds().width * 1.20;
    }
}
