Welcome, Guest. Please login or register. Did you miss your activation email?

Show Posts

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.


Messages - DanTheMan

Pages: [1]
1
Window / [SOLVED] - Input Text Box whilst using State Machine
« on: December 23, 2020, 05:36:49 pm »
Good Evening all,

I've decided to use a statemachine for my game i.e main menu > character selection and so on and so forth.
I'm not at a stage of creating input/textbox's for users to type their name / login to the game but for the life of me i cant get it working.

ordinarily i know the code for TextEntered should go within the Event Loop in main.cpp
However due to the state Machine being used i only need it to appear on say MainMenuState.cpp but i cant figure why it wont work and i assume i need to some how poll events on each state but i've tried to no avail.

I can provide details / code examples when i get home but just wondered if anyone had any ideas off the top of their head?

Using this tutorial for the box's :

Solution: Turns out i had a game.cpp using the polling event whilst the window was open so it was essentially overriding it in any other .cpp

remove and now i can poll in any of my states :)

2
Network / Checking server status - help
« on: January 12, 2012, 02:51:45 am »
Hi, my names Daniel im farely new to SFML however im steadily learning its features and i have come to appreciate the features it offers.

now my question is, using the sfml2 tutorial on sockets, [which works fine by the way] how can i let the client know if the server is not up.

e.g. the user presses login > it sends a connection request > if it fails show an image.

im think it has to do with the following;

Code: [Select]
   if (socket.Connect(server, port) != sf::Socket::Done)
        return;
    std::cout << "Connected to server " << server << std::endl;



but i've tried a few methods like enclosing the if statement to use else, but it didnt work.

any help would be greatly appreciated, thank you.[/code]

Pages: [1]