One step further
// Project: typetest
// Created: 2018-01-13
// show all errors
SetErrorMode(2)
// set window properties
SetWindowTitle( "typetest" )
SetWindowSize( 1024, 768, 0 )
SetWindowAllowResize( 1 ) // allow the user to resize the window
// set display properties
SetVirtualResolution( 1024, 768 ) // doesn't have to match the window
SetOrientationAllowed( 1, 1, 1, 1 ) // allow both portrait and landscape on mobile devices
SetSyncRate( 30, 0 ) // 30fps instead of 60 to save battery
SetScissor( 0,0,0,0 ) // use the maximum available screen space, no black borders
UseNewDefaultFonts( 1 ) // since version 2.0.22 we can use nicer default fonts
type _typestrings
id
message$
endtype
global TypeString as _typestrings[10] // Amount of conversations
TypeString[0].message$ = "Boy: Hi...Wanna Hang Out?"
TypeString[1].message$ = "Grl: No.. Now go away!"
TypeString[2].message$ = "Boy: Awww. Why"
TypeString[3].message$ = "Grl: Cause boys are boring"
TypeString[4].message$ = "Boy: Fair enough"
TypeString[5].message$ = "Girl: Right... Im off shopping"
for a=0 to TypeString.length
TypeString[a].id = createtext("")
SetTextSize(TypeString[a].id, 50)
next
framestep#=timer():stringcount=1 : conversationid=0
do
SetTextPosition(TypeString[conversationid].id, 100,100+(conversationid*50))
if (timer()-framestep#>.1) // every 4 seconds add a letter
SetTextString(TypeString[conversationid].id, mid(TypeString[conversationid].message$,1,stringcount))
inc stringcount
framestep#=timer()
if stringcount>len(TypeString[conversationid].message$)
stringcount=1
inc conversationid
endif
endif
Print( ScreenFPS() )
Sync()
loop
lol