Text Input

Learn how to start making games.

Text Input

Postby PerrySteven » Mon Jan 25, 2016 9:44 am

Hello, I want to make a text-adventure type game in Game Editor, but the problem is I don't know how to create an input for text like at the bottom of this picture: http://ffp4g1ylyit3jdyti1hqcvtb-wpengin ... _45_PM.png

Any help would be much appreciated.
User avatar
PerrySteven
 
Posts: 46
Joined: Sun Jan 25, 2015 4:29 am
Location: Malaysia
Score: 1 Give a positive score

Re: Text Input

Postby MrJolteon » Mon Jan 25, 2016 9:57 am

In the Set Text window on a text actor, click the Text Input dropdown menu and select Yes. You should be able to enter text into that actor in game mode.

Image
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Text Input

Postby PerrySteven » Mon Jan 25, 2016 10:05 am

MrJolteon wrote:In the Set Text window on a text actor, click the Text Input dropdown menu and select Yes. You should be able to enter text into that actor in game mode.

Image


Okay, that's a start. But how do I allow the string to display a whole line? Currently, it only displays three characters at any one time.
User avatar
PerrySteven
 
Posts: 46
Joined: Sun Jan 25, 2015 4:29 am
Location: Malaysia
Score: 1 Give a positive score

Re: Text Input

Postby MrJolteon » Mon Jan 25, 2016 10:14 am

Just add some spaces in the text editor, and if needed, remove them in a create actor event.
Join us on Discord!
Game Editor 2
These are the best ways to reach me these days


Your local Community Janitor, always lurking in the shadows...
User avatar
MrJolteon
 
Posts: 2326
Joined: Sat Aug 09, 2008 3:25 pm
Location: Stranded under endless sky
Score: 105 Give a positive score

Re: Text Input

Postby PerrySteven » Tue Jan 26, 2016 4:50 am

MrJolteon wrote:Just add some spaces in the text editor, and if needed, remove them in a create actor event.


Thank you for that piece of information. Though now I have another obstacle, I want to pass the string that is typed by the user through a syntax algorithm. I think I have some idea on how to write a syntax algorithm, but trying to fetch what is typed by the player to be used in string operations is now my main problem.
User avatar
PerrySteven
 
Posts: 46
Joined: Sun Jan 25, 2015 4:29 am
Location: Malaysia
Score: 1 Give a positive score

Re: Text Input

Postby speckford123 » Wed Jan 27, 2016 8:13 am

PerrySteven wrote:
MrJolteon wrote:Just add some spaces in the text editor, and if needed, remove them in a create actor event.


Thank you for that piece of information. Though now I have another obstacle, I want to pass the string that is typed by the user through a syntax algorithm. I think I have some idea on how to write a syntax algorithm, but trying to fetch what is typed by the player to be used in string operations is now my main problem.


You could use something like this in your text actor
if(strcmp(text, "TextHere")==0) DoAThing;

But that would compare the entire text entered I think
Not quite sure how to compare individual words if you type more than one in the line
speckford123
 
Posts: 334
Joined: Fri May 05, 2006 6:33 pm
Score: 49 Give a positive score

Re: Text Input

Postby Opium » Mon Feb 29, 2016 9:03 pm

Oh you are more than unsure, spec.
You simply have no clue.

Use &string1[Index_to_the_offset_char_of_some_word]
as the first argument of the function strncmp
and how much characters to compare as 3rd.

Or use scanf to copy a word to a buffer.
It copies up to a whitespace so it is ideal for obtaining words.
Opium
 
Posts: 2
Joined: Wed Aug 12, 2015 2:13 pm
Score: 0 Give a positive score


Return to Getting Started

Who is online

Users browsing this forum: No registered users and 1 guest