Gamestudio Links
Zorro Links
Newest Posts
Data from CSV not parsed correctly
by EternallyCurious. 04/18/24 10:45
StartWeek not working as it should
by Zheka. 04/18/24 10:11
folder management functions
by VoroneTZ. 04/17/24 06:52
lookback setting performance issue
by 7th_zorro. 04/16/24 03:08
zorro 64bit command line support
by 7th_zorro. 04/15/24 09:36
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:48
Zorro FIX plugin - Experimental
by flink. 04/14/24 07:46
AUM Magazine
Latest Screens
The Bible Game
A psychological thriller game
SHADOW (2014)
DEAD TASTE
Who's Online Now
3 registered members (MadJack, AndrewAMD, Quad), 540 guests, and 1 spider.
Key: Admin, Global Mod, Mod
Newest Members
EternallyCurious, 11honza11, ccorrea, sakolin, rajesh7827
19046 Registered Users
Previous Thread
Next Thread
Print Thread
Rate Thread
Is it possible to enter the user's response in a text box? #483939
08/16/21 11:49
08/16/21 11:49
Joined: Jan 2012
Posts: 108
G
gamers Offline OP
Member
gamers  Offline OP
Member
G

Joined: Jan 2012
Posts: 108
Hi Dear Developers,
Is it possible to enter the user's response in a text box and automatically reduce the text to a bottom line according to the size of the text box?

For example, let's have a text box field as in Figure-1 and the user is required to enter a response in this field.

Figure-1
[Linked Image]

As seen in Figure 2, when the user starts to enter the response, the text goes out of the text box area.

Figure-2
[Linked Image]

Actually I want the desired output to be like in Figure 3. How can I do that?

Figure-3
[Linked Image]

Re: Is it possible to enter the user's response in a text box? [Re: gamers] #483963
08/18/21 14:58
08/18/21 14:58
Joined: Jan 2012
Posts: 108
G
gamers Offline OP
Member
gamers  Offline OP
Member
G

Joined: Jan 2012
Posts: 108
Please could you help me?

Last edited by gamers; 08/20/21 09:52.
Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484119
09/10/21 06:58
09/10/21 06:58
Joined: Jan 2012
Posts: 108
G
gamers Offline OP
Member
gamers  Offline OP
Member
G

Joined: Jan 2012
Posts: 108
Do you have any ideas?

Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484120
09/10/21 11:01
09/10/21 11:01
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
Why don't you try it? Make a short program and do some exercises. One of the best way to learn and get knowledge.

Re: Is it possible to enter the user's response in a text box? [Re: Aku_Aku] #484124
09/11/21 09:20
09/11/21 09:20
Joined: Jan 2012
Posts: 108
G
gamers Offline OP
Member
gamers  Offline OP
Member
G

Joined: Jan 2012
Posts: 108
Thanks for your response Aku_Aku. I tried to do this many times, but I didn't get the result I wanted. I wanted to ask because I think that forum friends who have knowledge and experience about the mentioned subject will potentially contribute. Sometimes trying many times to do things you don't know or can't do may not yield wanted results. Thank you for your understanding!

Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484125
09/11/21 09:33
09/11/21 09:33
Joined: May 2009
Posts: 5,370
Caucasus
3run Offline
Senior Expert
3run  Offline
Senior Expert

Joined: May 2009
Posts: 5,370
Caucasus
Hey, I've never done this type of input field myself. But I would start by looking into TEXT, text.size_x, text.size_y, flags (text) WWRAP and ttf fonts + I would change text's string using the inkey. For the background I would use a panel with a bmap.

Best regards!


Looking for free stuff?? Take a look here: http://badcom.at.ua
Support me on: https://boosty.to/3rung
Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484129
09/12/21 10:17
09/12/21 10:17
Joined: Sep 2009
Posts: 993
Budapest
Aku_Aku Offline
User
Aku_Aku  Offline
User

Joined: Sep 2009
Posts: 993
Budapest
OK I understand you.
You know there are two types of reading in text from keyboard: inkey and inchar.
I think the second way should choose for your case, that reads only one character at once.
The base of this case, you must to know how wide is one character in your character set. That defines how many character fit into one line, assumed the set isn't proportional type.
So, with inchar you know when the width of typed in chars summed up is equal your line width. Then you open a new line.
I made kind of this computing in the past but not for type in text but for write out text, so I think it should work.

As an alternate solution you can try propose of 3run with WRAP, maybe that should work too.

Last edited by Aku_Aku; 09/12/21 10:19.
Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484313
10/06/21 14:57
10/06/21 14:57
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
Yes it's possible, but it's not pretty. I do it in Star Explorers.
But when entering, the cursor and words kind of jump around a bit. When you hit enter, it fixes it, but during entry it is a bit strange.

Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484314
10/06/21 14:57
10/06/21 14:57
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
I am using inkey .... maybe I will try inchar and see what happens?

Re: Is it possible to enter the user's response in a text box? [Re: gamers] #484315
10/06/21 15:00
10/06/21 15:00
Joined: May 2005
Posts: 868
Chicago, IL
Dooley Offline
User
Dooley  Offline
User

Joined: May 2005
Posts: 868
Chicago, IL
As mentioned, WWRAP only works with truetype fonts. If you are using a bitmap font, it will keep going past the entry box, as you show in your first example.


Gamestudio download | chip programmers | Zorro platform | shop | Data Protection Policy

oP group Germany GmbH | Birkenstr. 25-27 | 63549 Ronneburg / Germany | info (at) opgroup.de

Powered by UBB.threads™ PHP Forum Software 7.7.1