I am completely lost as to how I am going to go about a system for talking to NPCs and displaying text boxes. I currently have it set up to listen for if the player is at one of the four tiles around an NPC and if a certain key is pressed but I’m not sure how to get it to recognize that key ONLY ONCE and execute the code to display the textbox only once as well.
Also, as far as getting a textbox on the screen, what is the best way to display text? I have a sprite for a textbox that is 1116 pixels long and 716 pixels high and I want to display text within it. The only way I can think of to get text on the screen is have a spritesheet of characters and display them in each of the slots the textbox is able to hold. Is there an easier way to do this?
So what I’d like to know is:
- How can I get a keypress to only be recognized once and make a boolean true once to make the textbox render to the screen?
- Is the method I mentioned very efficient for displaying the dialogue or is there an easier/more efficient way?