Hi all,
Here's another version that uses your print text across the screen program with a file of text messages to display
DEFLNG A-Z
SCREEN _NEWIMAGE(640, 480, 32)
WorkPage& = _LOADIMAGE("NEWGHOST_blu1.png")
CLS
GOSUB MakPhrases 'get the amount of lines so we can make a dim to gather them
IF maxlines& <> 0 THEN
DIM Phrases$(maxlines&)
GOSUB FillDim 'read individual phrases into the string dim
ELSE
PRINT "File not found": _DELAY 3: END
END IF
_DELAY .5
_DEST 0
Textprn$ = "Hello World !!!": RRow% = 2: CColumn% = 6: z% = 0: Pause! = .5
GOSUB Showtext
GOSUB Pickphrase
RRow% = 15: CColumn% = 20: z% = 0: Pause! = .050
DO
FOR x = 0 TO 261 STEP 67
_PUTIMAGE (100, 100)-(220, 190), WorkPage&, 0, (x, 0)-(x + 67, 67)
_DELAY .08
NEXT
GOSUB Showtext
LOCATE RRow%, CColumn%
PRINT STRING$(Length%, 32)
LOCATE 25, 4
PRINT " press + hold escape to exit"
GOSUB Pickphrase
LOOP UNTIL _KEYDOWN(27)
SYSTEM
END
'--------------------------------------------------------------------------
Showtext:
z% = 0
Length% = LEN(Textprn$)
FOR a = 1 TO Length%
LOCATE RRow%, CColumn% + z%
PRINT MID$(Textprn$, a, 1)
z% = z% + 1
_DELAY Pause!
NEXT a
RETURN
MakPhrases:
maxlines& = 0
ThisFile% = FREEFILE 'get next free file handle must be integer
OPEN "message.txt" FOR INPUT AS #ThisFile%
DO
INPUT #ThisFile%, temp$
maxlines& = maxlines& + 1
LOOP WHILE NOT EOF(ThisFile%)
temp$ = "" 'dump contents of string
CLOSE #ThisFile%
RETURN
FillDim:
maxlines& = 0
ThisFile% = FREEFILE 'get next free file handle must be integer
OPEN "message.txt" FOR INPUT AS #ThisFile%
DO
INPUT #ThisFile%, temp$
Phrases$(maxlines&) = temp$
maxlines& = maxlines& + 1
LOOP WHILE NOT EOF(ThisFile%)
temp$ = "" 'dump contents of string
CLOSE #ThisFile%
RETURN
Pickphrase:
Whatone% = INT(RND * maxlines&) 'make a random number to select exact phrase
Textprn$ = Phrases$(Whatone%)
RETURN
And here's the contents of the text file. You can add on or subtract lines in the file .
I am the ghost comeing to save the world
Hey help me EAT some dots!
Well im waiting for you to do something!
Ghost's who ya gonna call!
Get me into notepad and i'll eat more!
Well Garry whens Mick gonna give me more!
Nuclear reactors dont scare me!!!
Proton Pills are my favourite foods!
OlDosLover