TGC Codebase Backup



Textual problems solved by Seppuku Arts

19th Feb 2005 9:17
Summary

This is an easy code to make text switches that doesn't move quickly so that the reader can't read it



Description

This solves the problem where unexperience Dark Basic Pro and classic users where you press enter to change text in your program it doesn't skip quickly. The first bit shows the problem, the second is the correction



Code
                                    ` This code was downloaded from The Game Creators
                                    ` It is reproduced here with full permission
                                    ` http://www.thegamecreators.com
                                    
                                    
`this first bit of code is only to show you the problem don't use this

cls
sync on
sync rate 30
do
text 0,10," Tbis is the problem"
text 0,30,"you will not be able to read the next text"
if returnkey()=1 then goto notsolved
loop


notsolved:
cls
sync on
sync rate 30
do
text 0,10,"jingle bells jingle bells mermaid man smells"
text 0,30,"barnacle boy laid an egg, the invisible boat"
text 0,50,"mobile lost a wheel on the motorway, hey!"
text 0,70,",quote spongebob sqaurepants"
if returnkey()=1 then goto solved
loop






`this is a label, you should know what they are used for if not read the Dark BASIC help files
solved:
`this next bit of code you should use it solves this problem
`use this to stop flickering that occurs on most geForce chipsets
cls
`turn syncronisation on(advise to use this but not manditory)
sync on
sync rate 30
`variable so that the text doesn't flick through so fast
press# = 0

`start loop
do

text 0,10,"did you miss it, thats the problem"
text 0,30,"this is what it should be like"
`increase variable when return is pressed
if returnkey()=1 then inc press#,1
if returnkey()=0 then press# = 1
if press# > 3 then goto nextspeech
sync
loop

`repition of what i've just done but for the next text

nextspeech:
cls
sync on
sync rate 30
press#  = 0
do
text 0,10,"You can use this in your games"
if returnkey()=1 then inc press#,1
if returnkey()=0 then press# = 1
if press# > 3 then goto nextspeech2
sync
loop

`a second repeat, you can use this as many times as you want
nextspeech2:

cls
sync on
sync rate 30
press# = 0
do
text 0,10,"Without giving a single bit"
text 0,30,"of credit to me"
if returnkey()=1 then inc press#,1
if returnkey()=0 then press# = 1
if press# > 3 then end

sync
loop