Here is a quick example:
;############################################################# #
;# Quick and crap ATX cracktro remake by Padman. (c)11/2010 #
;# Uses a purebasic userlib by eNeRGy/dAWN for FC playback, #
;# which itself is based on a library by SiRioKD\Lockless. #
;###############################################################
Procedure.l KeyboardHit( KeyName.l )
Static Dim KeyFlag.b(255)
If KeyboardPushed(KeyName)
If KeyFlag(KeyName) = 0
KeyFlag(KeyName) = 1
ProcedureReturn 1
Else
ProcedureReturn 0
EndIf
Else
KeyFlag(KeyName) = 0
ProcedureReturn 0
EndIf
EndProcedure
;###############mod by Jace/St Knights #############################
#size=57 ; size of the line
ptext = 0 ; index of the text for each page
pausetext = 2*60 ; 2 * 60 frames for 2 seconds
text.s=" ____ __ __________________ _______ ___ "
text + " +------\ \| \| __ __/| _____ \/ \ \/ /-----+ "
text + " :::::::/_/| \ |/ | _ | _|/ / /\_ \_ /::::::: "
text + " ::::::/ \__ \ \ _/ | | | \_ \ \_/ / \::::::: "
text + " :::::\ _||__/ |\_\____|__| |__|\ \_____/ /\__/:::::: "
text + " +-----\/----|__|----------|__|----\__/--\__/----------+ "
text + " "
text + " * FOR FUN, NOT STATUS * "
text + " "
text + " "
text + " ------------------------------------------------ "
text + " Bully's Sporting Darts From Alternative Software "
text + " ------------------------------------------------ "
text + " "
text + " "
text + " "
text + "Original Music By ROB HUBBARD, Amiga Rendition By WALKMAN"
text + " "
text + " Page 2 "
text + " "
text + " "
text + " "
text + " "
text + " bla bla "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " Page 3 "
text + " "
text + " "
text + " "
text + " "
text + " bla bla "
text + " "
text + " "
text + " "
text + " "
text + " "
text + " and looooop! "
text + " "
text + " "
text + " "
text + " "
Procedure StaticText(spritenr,x,y,width,height,txt$)
For n=1 To Len(txt$)
a = Asc(Mid(txt$,n,1))-32
ClipSprite(spritenr, a * width, 0, width, height)
DisplayTransparentSprite(spritenr, x + width * (n-1), y)
Next
EndProcedure
Procedure DisplayText(pt,t.s)
Protected x = ((720-#size*8)/2)
Protected y = 77
For i=0 To 17-1
StaticText(0,x,y,8,16,Mid(t,(pt+1)+i*#size,#size)) ;beware : mid() starts at 1 :D
y + 14
Next i
EndProcedure
;###################################################################
InitSprite()
InitKeyboard()
window=OpenWindow(0, 0, 0, 720, 568, "ATX Remake", #PB_Window_BorderLess | #PB_Window_ScreenCentered )
OpenWindowedScreen(WindowID(0), 0, 0, 720, 568, #True, 0, 0) ; the #True flag sets the screen to autostretch
If window = 0
MessageRequester("Error", "Can't open windowed screen!", 0) ; at least some error handling
End
EndIf
CatchSprite(0,?font) ; load our font
CatchSprite(1,?logo) ; load our logo
dAWN_TinyFC4Play(?song,1) ; load and start playing the FC module, "1" means it's played from memory
; "0" will play from a file:
;
; song.s="delta fc"
; dAWN_TinyFC4Play(@song,0)
Repeat
ClearScreen(0)
If WaitWindowEvent(1) = #PB_Key_Escape : End :EndIf
;let's draw the background stuff
StartDrawing(ScreenOutput())
Box(0,35,720,2,$FFFFFF) ;Upper line
Box(0,37,720,356,$553333) ;Text background
Box(0,393,720,2,$FFFFFF) ;Lower line
StopDrawing()
;###############mod by Jace/St Knights #############################
DisplayText(ptext,text) ; display the text
pausetext - 1
If pausetext = 0
pausetext = 2*60 ;60 frames in each seconds (you can use elapsed time for millisecond count)
ptext + #size*17 ; add a page
If ptext >= Len(text)
ptext = 0 ;restart
EndIf
EndIf
;##################################################################
DisplaySprite(1,((720-SpriteWidth(1))/2),404) ; last but not least display the logo
ExamineKeyboard() ; check if some buttons have been pressed
If KeyboardHit(#PB_Key_Space) ; if it's [SPACE] then we'll switch between windowed and fullscreen
If Status=0 : Status = 1 :Else : Status = 0 : EndIf
EndIf
; very crappy windowed / fake fullscreen switch, too lazy for a proper fullscreen version ;)
Select Status
Case 0
ShowWindow_(WindowID(0),#SW_NORMAL) ;WinAPI calls won't work in the Demo of PureBasic!
Case 1
ShowWindow_(WindowID(0),#SW_MAXIMIZE)
EndSelect
FlipBuffers() ; flip da screen
Until KeyboardPushed(#PB_Key_Escape) ;until someone gets bored and presses [ESC]
dAWN_TinyFC4Free() ; unload the FC module
End ;buhbye
DataSection
logo: IncludeBinary "logo.bmp"
font: IncludeBinary "font.bmp"
song:IncludeBinary "delta.fc"
EndDataSection