I have added you
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.
Show posts Menu
#include <TGUI/TGUI.hpp>
#include <iostream>
void loadObjects( tgui::Window& window )
{
// Create the background image
tgui::Picture* picture = window.add<tgui::Picture>();
picture->load("Back1.png");
picture->setSize(800, 600);
std::cout << "1\n";
// Create the username label
tgui::Label* labelUsername = window.add<tgui::Label>();
labelUsername->setText("Username:");
labelUsername->setPosition(200, 100);
std::cout << "2\n";
// Create the password label
tgui::Label* labelPassword = window.add<tgui::Label>();
labelPassword->setText("Password:");
labelPassword->setPosition(200, 250);
std::cout << "3\n";
// Create the username edit box
tgui::EditBox* editBoxUsername = window.add<tgui::EditBox>(); std::cout << "3.2\n";
editBoxUsername->load("objects/EditBox/Black"); std::cout << "3.4\n";
editBoxUsername->setSize(400, 40); std::cout << "3.6\n";
editBoxUsername->setPosition(200, 140); std::cout << "3.8\n";
std::cout << "4\n";
// Create the password edit box (we will copy the previously created edit box)
tgui::EditBox* editBoxPassword = window.copy(editBoxUsername);
editBoxPassword->setPosition(200, 290);
editBoxPassword->setPasswordChar('*');
std::cout << "5\n";
// Create the login button
tgui::Button* button = window.add<tgui::Button>();
button->load("objects/Button/Black");
button->setSize(260, 60);
button->setPosition(270, 440);
button->setText("Login");
std::cout << "6";
}
int main()
{
// Create the window
tgui::Window window(sf::VideoMode(800, 600), "TGUI window");
// Load the font (you should check the return value to make sure that it is loaded)
window.globalFont.loadFromFile("D:/TGUI/Fonts/DejaVuSans.ttf");
loadObjects( window );
while (window.isOpen())
{
sf::Event event;
while (window.pollEvent(event))
{
if (event.type == sf::Event::Closed)
window.close();
// Pass the event to all the objects (if there would be objects)
window.handleEvent(event);
}
window.clear();
// Draw all created objects
window.drawGUI();
window.display();
}
return EXIT_SUCCESS;
}