1
Network / _debugger_hook_dummy = 0
« on: June 22, 2010, 08:43:41 pm »
Well, I updated the sfml version from 1.5 to 1.6 and it solved the problem. Still I was unable to get it solved if i were in 1.5.
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.
cp::cpGuiContainer gui;
cp::cpButton buttonok(&Window, &gui, "Aceitar", (input.GetPosition().x + (input.GetSize().x / 2) - 50 ), (input.GetPosition().y + input.GetSize().y + 10), 100, 50);
if(buttonok.CheckState(&Window.GetInput()) == cp::CP_ST_MOUSE_LBUTTON_RELEASED)
{
player1.Nick = input.GetLabelText();
Window.ShowMouseCursor(true);
if (ScoreBoard(Window))
return 0;
if (Menu(Window))
return 0;
Initialize(balloon, object, hand, time, player1.SScore, player1.Score, buttonok, input);
}
while (Window.IsOpened())
{
Event Event;
//Update
while (Window.GetEvent(Event));
{
if (Event.Type == Event::Closed)
return true;
...
}
}
cp::cpGuiContainer Gui;
cp::cpButton button1(&Window, &Gui, "MENU", 512 - 42, 600, 100, 50);
cp::cpButton button2(&Window, &Gui, "FTP", 600, 600, 100, 50);
//main loop
while (Window.IsOpened())
{
Event Event;
//Update
while (Window.GetEvent(Event));
{
//Gui.ProcessKeys(&Event);
if (Event.Type == Event::Closed)
return true;
}
if(button1.CheckState(&Window.GetInput()) == cp::CP_ST_MOUSE_LBUTTON_RELEASED)
{
return false;
}
if(button2.CheckState(&Window.GetInput()) == cp::CP_ST_MOUSE_LBUTTON_RELEASED)
{
FTPserver();
}
}
bool Menu(sf::RenderWindow &Window);
bool ScoreBoard(sf::RenderWindow &Window);
if (ScoreBoard(Window))
return 0;
if (Menu(Window))
return 0;
//both Menu and ScoreBoard Event loop
while (Window.GetEvent(Event));
{
gui.ProcessKeys(&Event); //only ScoreBoard has this line
if (Event.Type == Event::Closed)
return true;
}
I solved this really easy (it's on the wiki): just copied the cpGui.cpp and .h files into my project, and it ran like it should
balloon[i].SetIsAlive(false);
object[i].Drop = true;
object[i].BalloonIndex = i;
GenBalloons(i, balloon);
works fineballoon[i].SetIsAlive(false);
object[i].Drop = true;
object[i].BalloonIndex = i;
GenBalloons(i, balloon);
//-----------------
object.resize(object.size() + 1);
if (!object[object.size() - 1].Image.LoadFromFile("main\\object1.png"))
return 1;
object[object.size() - 1].Sprite.SetImage(object[object.size() - 1].Image);
object[object.size() - 1].Sprite.SetCenter(object[object.size() - 1].Sprite.GetSize().x / 2, object[object.size() - 1].Sprite.GetSize().y / 2);
object[object.size() - 1].Sprite.SetPosition((balloon[i].Sprite.GetPosition().x - object[object.size() - 1].Sprite.GetPosition().x) / 2, (balloon[i].Sprite.GetPosition().y - object[object.size() - 1].Sprite.GetPosition().y) / 2);
object[object.size() - 1].Drop = false;
object[object.size() - 1].SetIsAlive(true);
object[object.size() - 1].BalloonIndex = i;
object[object.size() - 1].SetSpeed(object[i].GetSpeed());
for (int i=0;i<BALLOONINDEX;i++)
{
//if (object[i].Drop == true && ObjectColHand(i, object, hand) == false)
Window.Draw(object[i].Sprite);
}