LoginLogin
Nintendo shutting down 3DS + Wii U online services, see our post

Basic Textboxes.

Root / Submissions / [.]

JINC_DEVCreated:
In this tutorial I will teach you how to make a simple text box. A simple text box: This is just simply a box with text in it that disappears when the A button is pressed:
PRINT "_____________________
PRINT "IHELLO  WORLD!!!!!!II
PRINT "---------------------
That prints the text box(Yes I know the text box looks terrible but in SmileBASIC there are text characters that can be used to make proper Text Boxes). Now to make the text box disappear when A is pressed(Put this under the textbox:
WHILE 1
IF BUTTON(2) AND #A THEN BREAK
WEND
CLS
And that's it, simple right.

i have a better one that uses DEFs

Not to hate on this, as it may help some beginners, but there is already a few lines of code I found through the Dungeon Tanken game (in the samples folder) that generates a box made out of text characters. Your suggestion may take up less space in the code though, but I would need to check.

Replying to:Arkzen
Not to hate on this, as it may help some beginners, but there is already a few lines of code I found through the Dungeon Tanken game (in the samples folder) that generates a box made out of text characters. Your suggestion may take up less space in the code though, but I would need to check.
the one i have that uses DEFs is still better

Replying to:Arkzen
Not to hate on this, as it may help some beginners, but there is already a few lines of code I found through the Dungeon Tanken game (in the samples folder) that generates a box made out of text characters. Your suggestion may take up less space in the code though, but I would need to check.
Would you care to explain it instead of just saying it uses DEFs?

Replying to:Arkzen
Not to hate on this, as it may help some beginners, but there is already a few lines of code I found through the Dungeon Tanken game (in the samples folder) that generates a box made out of text characters. Your suggestion may take up less space in the code though, but I would need to check.
it's a bit long plus i can't remember the code i'm playing a game that doesn't have saving ATM so i'll tell you later

good for biginers but i believe if you wanted to use this a lot you would want to make a DEF such as
DEF BTN
WHILE BUTTON()!=#A:WEND:CLS
END
now when you put BTN anywhere in your code it will stop you until you press A otherwise just do WHILE BUTTON()!=#A:WEND:CLS Theres really no better way to do a text box... though if you don't want that sometimes annoying "one character at a time" thingy you can always use GPUTCHR for much better placing stuff