? Text stuff (Page 1) ● SmileBASIC Source Forums

Sign In

Register
*Usernames are case-sensitive
Forgot my password

Text stuff

  • #1 ✎ 17 Retrogamer123 How do you make text that appears one letter at a time, like when a person talks in some RPGs? Posted
  • #2 ✎ 167 Mariominer First Day Joined on the very first day of SmileBASIC Source Website Promoted Page My page was promoted on SmileBASIC Source! Achievements Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength 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! Posted Edited by Mariominer
  • #3 ✎ 203 JustGreat First Month Joined in the very first month of SmileBASIC Source Website Avatar Taboo I didn't change my avatar for 180 days Website Night Person I like the quiet night and sleep late. Express Yourself Alternatively, 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
  • #4 ✎ 43 CodeTrooper
    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 Edited by CodeTrooper
  • #5 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself How do you make text go in front of everything on the screen? Posted
  • #6 ✎ 383 gallus OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! Second Year My account is over 2 years old Website Good Page Hidden Achievements 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. Posted Edited by gallus
  • #7 ✎ 94 CyberYoshi64 Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Console 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,-256 You 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 ✎ 383 gallus OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! Second Year My account is over 2 years old Website Good Page Hidden Achievements
    upgraded version of my post
    Your text must have less than 512 characters shown at a time. (Even less if you use sprites for something else.)
    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.
    Posted
  • #9 ✎ 94 CyberYoshi64 Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself
    ...
    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
  • #10 ✎ 383 gallus OSP Contest 1 Contest Participant I participated in the first SmileBASIC Source OSP Contest! Second Year My account is over 2 years old Website Good Page Hidden Achievements
    ...
    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! How to make a sprite from text! - chicken
    Posted
  • #11 ✎ 94 CyberYoshi64 Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself
    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 Edited by CyberYoshi64
  • #12 ✎ 109 Z_E_R_O Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself Zelda Is Awesome! I love The Legend Of Zelda! Express Yourself Umm... Thanks guys..? 😂 I figured out it was just an error of where I put that loop... So yeah... Posted
  • #13 ✎ 91 niconii Video Games I like to play video games! Hobbies Expert Programmer Programming no longer gives me any trouble. Come to me for help, if you like! Programming Strength Drawing I like to draw! Hobbies MID$(S$,I,1) can be written as S$[I]. Posted
  • #14 ✎ 94 CyberYoshi64 Avatar Taboo I didn't change my avatar for 180 days Website Intermediate Programmer I can make programs, but I still have trouble here and there. Programming Strength Night Person I like the quiet night and sleep late. Express Yourself
    MID$(S$,I,1) can be written as S$[I].
    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 Edited by CyberYoshi64