Sign In

Text stuff

#1✎ 17Retrogamer123How do you make text that appears one letter at a time, like when a person talks in some RPGs?
Posted 3 years ago

#2✎ 167MariominerFirst DayJoined on the very first day of SmileBASIC SourceWebsitePromoted PageMy page was promoted on SmileBASIC Source!AchievementsExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthI use FOR loops with LEFT$.
FOR I=0 TO LEN(YOLO$)-1
CLS
?LEFT$(YOLO$,I)
WAIT 5
NEXT
If you want it any more complex, then you can hopefully work it out based on this.
Hope this helps!
Posted 3 years ago
Edited 3 years ago
by Mariominer

#3✎ 202JustGreatFirst MonthJoined in the very first month of SmileBASIC SourceWebsiteAvatar TabooI didn't change my avatar for 180 daysWebsiteNight PersonI like the quiet night and sleep late.Express YourselfAlternatively, you could try something involving semicolons. When printing text, you can put a semicolon after the ending quotation mark to stop the program from automatically time breaking. Whatever you do to make it go through each letter individually is up to you.
Posted 3 years ago

How do you make text that appears one letter at a time, like when a person talks in some RPGs?

I use FOR loops with LEFT$.
FOR I=0 TO LEN(YOLO$)-1
CLS
?LEFT$(YOLO$,I)
WAIT 5
NEXT

You can also avoid repetition by making your own command:
DEF TEXTTALK X,Y,S$,SPEED
FOR I=0 TO LEN(S$)
LOCATE X,Y:PRINT LEFT$(S$,I)
BEEP 9
VSYNC SPEED
NEXT
END
Then, whenever you use something like TEXTTALK 0,0,"Hello. I am talking text.",3 then it should do as you described, Retro. You can use it in Direct mode (If the DEF command is in slot 1.) and in Edit mode.
Posted 3 years ago
Edited 3 years ago
by CodeTrooper

#5✎ 109Z_E_R_OIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthNight PersonI like the quiet night and sleep late.Express YourselfZelda Is Awesome!I love The Legend Of Zelda!Express YourselfHow do you make text go in front of everything on the screen?
Posted 8 months ago

#6✎ 438kenchicAvatar TabooI didn't change my avatar for 180 daysWebsiteThird YearMy account is over 3 years oldWebsiteosu! Is Awesome!I love osu!Express YourselfIf you're using the console, use LOCATE X,Y,Z where Z is lower than any others, like sprites and stuff. (min -256 or -255 idunno)
If you're using graphics, use GPRIO Z with the same sort of idea.
Have an amazing day, and as always, use autofill and the help button TO GET A BASIC UNDERSTANDING OF THE COMMANDS YOU'RE USING.
Posted 8 months ago
Edited 8 months ago
by kenchic

#7✎ 145CyberYoshi64Avatar TabooI didn't change my avatar for 180 daysWebsiteFirst YearMy account is over 1 year oldWebsiteGood PageHiddenAchievementsConsole screen (Just text characters): LOCATE X,Y,-256
Graphic screen (Graphics obviously): GPRIO -256Everything drawn on the graphics screen will be in front of everything else.
Sprites: SPOFS MN,X,Y,-256You can make characters individually moving around or something else.Your text must have less than 512 characters shown at a time. (Even less if you use sprites for something else.)
If you get confused, don't worry, the autocomplete and the help button are there for you. (lol XD)
Posted 8 months ago

Not quite true. You can use sprites for both gameplay and text by moving the text away from where your regular sprites are stored.
Just wanted to make this clear.

What I mean is...
There are 512 available slots for sprites and as you said, there could be some sprites already used for enemies or the player itself, a few slots became used.
What you mean is (i guess)...
You can think about you need up to 256 slots for example just for gameplay elements and after slot 256, you can use 255 character sprites to make text out of them.
That's what I meant with "Even less (than 512) if you use sprites for something else.!
Posted 8 months ago

Not quite true. You can use sprites for both gameplay and text by moving the text away from where your regular sprites are stored.
Just wanted to make this clear.

What I mean is...
There are 512 available slots for sprites and as you said, there could be some sprites already used for enemies or the player itself, a few slots became used.
What you mean is (i guess)...
You can think about you need up to 256 slots for example just for gameplay elements and after slot 256, you can use 255 character sprites to make text out of them.
That's what I meant with "Even less (than 512) if you use sprites for something else.!

You can edit the sprite definition in real time. You don't need to use a sprite for every single character in your text!

But what about 32x32 or 16x16 bitmapped characters to form text. LinkZ19's ClockZ has a 8x16 font (A-Z) hidden in it's sprite sheet. My upcoming game will use 8x8, 16x16 and 32x32 fonts for various interfaces.
EDIT: If a size of one character like "i" should be different such font sets are better, as they do not need much programming to accomplish drawing them.
'---
SPPAGE 4
GPAGE 0,4
S$="Nice day!"
X=90Y=66
FOR I=0 TO LEN(S$)-1
GPUTCHR X,Y,MID$(S$,I,1)
IF MID$(S$,I,1)=="i" THEN INC X,4
... 'if needed, more of them!
ELSE INC X,8
ENDIF
...
NEXT
'---Unlike normal text, sprites used for text can change their color, their position, like when a person yells at someone, or become squished or streched on the fly. SPANIM can be used, for example, to automatically change colors. This can be used for ... a "CONGRATULATIONS!" string or so. My game will make use of it.Maybe I should create a page "Make text out of sprites" for skilled programmers...
Posted 8 months ago
Edited 8 months ago
by CyberYoshi64

#12✎ 109Z_E_R_OIntermediate ProgrammerI can make programs, but I still have trouble here and there. Programming StrengthNight PersonI like the quiet night and sleep late.Express YourselfZelda Is Awesome!I love The Legend Of Zelda!Express YourselfUmm... Thanks guys..? 😂
I figured out it was just an error of where I put that loop... So yeah...
Posted 8 months ago

#13✎ 102niconiiVideo GamesI like to play video games!HobbiesExpert ProgrammerProgramming no longer gives me any trouble. Come to me for help, if you like!Programming StrengthDrawingI like to draw!HobbiesMID$(S$,I,1) can be written as S$[I].
Posted 8 months ago

Thanks!Never knew that string variables can be handled as sort of arrays. It might take a few spoilers! XDSorry about that. lolAlthough I know that character strings or such variables are sort of arrays storing each character's ID...
Posted 8 months ago
Edited 8 months ago
by CyberYoshi64