Here it goes
Main.cpp
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);
}
Menu.cpp
while (Window.IsOpened())
{
Event Event;
//Update
while (Window.GetEvent(Event));
{
if (Event.Type == Event::Closed)
return true;
...
}
}
ScoreBoard.cpp
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();
}
}