The Game Creators
The Game Creators Home Click to Login
  Hot: August NewsletterAGK
The Game Creators
AGK Product Chat / Text input

Go to the first page of this board Return to the Forum Menu Post Message
13 Messages - Page   of 1   
Bookmark and Share Search the Forum

Author Message
Doveyy04

User


Joined: Mon Apr 30th 2012
Location: Cyberspace
Posted: 16th May 2012 13:11           | link | toggle

In the example "Text input" it prints the text that you type in at the top of the screen because the command is just print text$ , but how do you print the (text$) in a different location, style etc? I've tried doing Createtext (1, text$) then settextlocation etc but it's not printing it where I want it. Does it have to be as a Createtext command or can you locate Print to be in a certain place colour style etc like in old Basic
Back to top
Report this message as abusive
Ancient Lady

AGK Master


Joined: Wed Mar 17th 2004
Location: Virginia, USA
Posted: 16th May 2012 16:05           | link | toggle

Have a cruise around the documentation for Text: http://www.appgamekit.com/documentation/Reference/Text.htm

After you use CreateText (and save the returned id for other commands), you may need to make sure that it's depth is above any background objects and you can position it anywhere you want in the display.

Cheers,
Ancient Lady
Back to top
Report this message as abusive
Mobiius

AGK Developer


Joined: Thu Feb 27th 2003
Location: Cramlington baby, yeah!
Posted: 16th May 2012 16:53           | link | toggle

Print just displays text from the top of the screen down. To position text, you'll need to createtext and settextposition to display it elsewhere.

(Think of print as debug only, and the proper text commands as final version ones)

I live for video games! (And beers, and football, and cars!)
Back to top
Report this message as abusive
Doveyy04

User


Joined: Mon Apr 30th 2012
Location: Cyberspace
Posted: 16th May 2012 19:50           | link | toggle

tried settextdepth but text not printing at all, ive even tried clearing the screen after text input but it doesnt clear. How do I put a copy of my program on here as a clipit so people can view it and see where I have gone wrong???
Back to top
Report this message as abusive
Ancient Lady

AGK Master


Joined: Wed Mar 17th 2004
Location: Virginia, USA
Posted: 16th May 2012 23:11           | link | toggle

You can either upload the entire zipped project (use the 'Browse' button in the 'Post Forum Message' dialog).

Or you can put just the code in a code bit using the 'code' buttons:
+ Code Snippet

Cheers,
Ancient Lady
Back to top
Report this message as abusive
TonytheTiger

User


Joined: Mon May 14th 2012
Location: Cyberspace
Posted: 17th May 2012 00:22           | link | toggle

I can't get textinput to work either. How hard can it be to enter 4 values into 4 variables. I know the code below is wrong it is only like the 100th idea I have come up with. The documentation is not clear to me on this. Does the gettextinput work in a loop to build a string. What I would give for a input statement. Any ideas all. thanks


Starttextinput ()
who$ = GetTextInput ( )
StopTextInput( )
Starttextinput ()
what$ = GetTextInput ( )
StopTextInput( )
Starttextinput ()
where$ = GetTextInput ( )
StopTextInput( )
Starttextinput ()
save$ = GetTextInput ( )
StopTextInput( )
Back to top
Report this message as abusive
Google Ad
Back to top
 
Ancient Lady

AGK Master


Joined: Wed Mar 17th 2004
Location: Virginia, USA
Posted: 17th May 2012 16:18           | link | toggle

It appears that you aren't using the commands quite right.

This is the AGK example (ignoring the background image/sprite):
+ Code Snippet

The commands are not called sequentially. StartTextInput() opens the input box and then the app keeps rolling. You then have to keep checking to see if the input was completed, then you can get the value.

Cheers,
Ancient Lady
Back to top
Report this message as abusive
TonytheTiger

User


Joined: Mon May 14th 2012
Location: Cyberspace
Posted: 18th May 2012 02:01           | link | toggle

Thanks Ancient lady,

I know how to do one entry in a loop. I need to enter about 6 values into a table. I have the table/array and saving to a file done.

Can not seem to be able to input values. I am not understanding getextinput. The documentation doesn't really say much more than show the same example your showing.

I need to something like
input a$,b$,c$

or anything else that I can do data entry with.
Back to top
Report this message as abusive
DVader

AGK Developer


Joined: Wed Jan 28th 2004
Location: Cyberspace
Posted: 18th May 2012 02:27           | link | toggle

Your programming style reminds me of a friends program many years back I'm sure you will get into loops and such pretty quick.
Try this to alter text. I have modified the above example with a couple of lines.
+ Code Snippet

Back to top
Report this message as abusive
TonytheTiger

User


Joined: Mon May 14th 2012
Location: Cyberspace
Posted: 18th May 2012 03:07           | link | toggle

I guess you don't understand. I need to enter multiple items. You code only enters one entry then it prints it. I need to ask player
Name
Age
Character Name
and location

How do I do this, I seem to only be able to enter one value in loop.
If I add multiple gettextinput they don't work.

I can do this in any other language in one or two lines.
Back to top
Report this message as abusive
Funnell7

AGK Developer


Joined: Thu Sep 8th 2011
Location: UK, England
Posted: 18th May 2012 15:37     Edited: 18th May 2012 15:40     | link | toggle

There may be a much better way of doing this, but this seems to work:

+ Code Snippet

In this example I'm using the 'Print' command but you could easily change this to a 'CreateText' instead... You will obvioulsy need to add some text so the user knows what you are asking them to update, and you may want to put a check in to ensure they have actually updated some info before moving on to the next stage...
Back to top
Report this message as abusive
Ancient Lady

AGK Master


Joined: Wed Mar 17th 2004
Location: Virginia, USA
Posted: 18th May 2012 16:23           | link | toggle

You might also want to look at the EditBox functions.

The example in Text->Editboxes shows how to put up multiple boxes and customize them. I would highly recommend commenting out the SetEditBoxScissor line before compiling and running. I don't know why anyone would need such a command (but I could be very wrong).

Going with the simpler edit box (the first one) is probably enough.

You can create a page with Text objects as prompts above appropriate edit boxes and have a button to press when all the input is done.

Cheers,
Ancient Lady
Back to top
Report this message as abusive
Ancient Lady

AGK Master


Joined: Wed Mar 17th 2004
Location: Virginia, USA
Posted: 18th May 2012 17:21     Edited: 18th May 2012 17:24     | link | toggle

Try variants of this:
+ Code Snippet

Yes, it could be done differently. This was just hashed together quickly.

Cheers,
Ancient Lady
Back to top
Report this message as abusive

Go to the first page of this board Return to the Forum Menu Post Message
13 Messages - Page   of 1   
Search the Forum

Sorry, but it has been so long since anyone replied to this Thread that it has been automatically locked.
You may read it but not reply.

Forum Search

Enter a word or phrase to search our Forum for:

Thread Subject Search
Search Phrase:
Search Scope: Entire forum
Just this board
 
Google Forum Search
Search Phrase:
 
Apollo v2.02


Dark Game Studio
Privacy Policy AUP Top of Page