Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

Author
Message
Doveyy04
11
Years of Service
User Offline
Joined: 30th Apr 2012
Location:
Posted: 16th May 2012 14:11
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
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 16th May 2012 17:05
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
Mobiius
Valued Member
21
Years of Service
User Offline
Joined: 27th Feb 2003
Location: The Cold North
Posted: 16th May 2012 17:53
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!)
Doveyy04
11
Years of Service
User Offline
Joined: 30th Apr 2012
Location:
Posted: 16th May 2012 20:50
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???
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th May 2012 00:11
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:


Cheers,
Ancient Lady
TonytheTiger
11
Years of Service
User Offline
Joined: 14th May 2012
Location:
Posted: 17th May 2012 01:22
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( )
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 17th May 2012 17:18
It appears that you aren't using the commands quite right.

This is the AppGameKit example (ignoring the background image/sprite):


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
TonytheTiger
11
Years of Service
User Offline
Joined: 14th May 2012
Location:
Posted: 18th May 2012 03:01
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.
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 18th May 2012 03:27
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.


TonytheTiger
11
Years of Service
User Offline
Joined: 14th May 2012
Location:
Posted: 18th May 2012 04:07
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.
Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 18th May 2012 16:37 Edited at: 18th May 2012 16:40
There may be a much better way of doing this, but this seems to work:



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...
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th May 2012 17:23
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
Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 18th May 2012 18:21 Edited at: 18th May 2012 18:24
Try variants of this:


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

Cheers,
Ancient Lady

Login to post a reply

Server time is: 2024-03-28 13:56:01
Your offset time is: 2024-03-28 13:56:01