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

Author Topic: [SOLVED] - Input Text Box whilst using State Machine  (Read 4122 times)

0 Members and 1 Guest are viewing this topic.

DanTheMan

  • Newbie
  • *
  • Posts: 2
    • View Profile
[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 :)
« Last Edit: December 24, 2020, 10:39:47 am by DanTheMan »

 

anything