1
DotNet / .net clock
« on: November 07, 2010, 02:13:16 am »
Where did it go?
This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
images["BGGround"].LoadFromFile("resources/background/ground.png");
for(unsigned int i = 0; i < width+2; i++)
{
sf::Sprite groundTile;
groundTile.SetCenter(0,0);
groundTile.SetImage(images["BGGround"]);
groundTile.SetPosition(-(float(width)/2 +1)*64+i*64,0);
background.push_back(groundTile);
}
while(newstagewnd.GetEvent(event))
{
if(event.Type == sf::Event::KeyPressed and event.Key.Code == sf::Key::Back)
{
if(titlein.value.size()>0)
{
titlein.value.resize(titlein.value.size()-1);
}
}
if(event.Type == sf::Event::TextEntered)
{
if(event.Text.Unicode < 256)
{
titlein.addinput(static_cast<char>(event.Text.Unicode));
}
}
if(event.Type == sf::Event::Closed)
{
newstagewnd.Close();
}
}
if(event.Type == sf::Event::TextEntered)
{
std::string str;
if(event.Text.Unicode < 256)
{
str = (std::string)event.Text.Unicode;
}
titlein.addinput(str);
}
error: invalid conversion from `sf::Uint32' to `const char*'
textbutton okbutton(24, 24, 64, 32);
okbutton.settext("OK", resmgr.fonts["tuffy"]);
struct textbutton : button
{
sf::String text;
void settext(std::string newtext, sf::Font newfont);
void drawtext(sf::RenderWindow *app);
textbutton() : button::button(){};
textbutton(int nx, int ny, int nw, int nh) : button::button(nx, ny, nw, nh){};
};
void textbutton::settext(std::string newtext, sf::Font newfont)
{
text.SetFont(newfont);
text.SetSize(12);
--->text.SetText(newtext);
}