I 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!
Text stuff
Root / Programming Questions / [.]
Retrogamer123Created:
How do you make text that appears one letter at a time, like when a person talks in some RPGs?
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$.You can also avoid repetition by making your own command:FOR I=0 TO LEN(YOLO$)-1 CLS ?LEFT$(YOLO$,I) WAIT 5 NEXT
DEF TEXTTALK X,Y,S$,SPEED FOR I=0 TO LEN(S$) LOCATE X,Y:PRINT LEFT$(S$,I) BEEP 9 VSYNC SPEED NEXT ENDThen, 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.
If 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.
Console screen (Just text characters):
Sprites:
If you get confused, don't worry, the autocomplete and the help button are there for you. (lol XD)
LOCATE X,Y,-256Graphic screen (Graphics obviously):
GPRIO -256
Disadvantage
Everything drawn on the graphics screen will be in front of everything else.SPOFS MN,X,Y,-256
Benefits
You can make characters individually moving around or something else.Disadvantage
Your text must have less than 512 characters shown at a time. (Even less if you use sprites for something else.)upgraded version of my postNot 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.Your text must have less than 512 characters shown at a time. (Even less if you use sprites for something else.)
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...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.
the spoiler
"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! How to make a sprite from text! - chickenWhat 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...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.!the spoiler
"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.
"You could do that with that technique"
'--- 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 '---
another benefit
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.Spoiler
Maybe I should create a page "Make text out of sprites" for skilled programmers...MID$(S$,I,1) can be written as S$[I].Thanks!