Here you go
Edit: A version higher texture resolution:
Code:
include "s3d.n7"
set window "Cool text", 640, 480, false
set redraw off
' create font and a texture (image).
set font createfont("arial", 16, true)
tex = createimage(256, 512)
' set target image to the one we created and write some
' text to it.
set image tex
set color 255, 200, 0
set caret 128, 0
center "Episode VII"
set caret 0, fheight()*2
for i = 0 to 28 wln "This is text. This is text. This is text. Yes."
wln "The end."
' set image to primary (window) again.
set image primary
' Init s3d.
S3D_SetView(primary, rad(90), 0.1, 2)
S3D_SetPerspectiveCorrection(S3D_NORMAL)
' text z, scroll value.
textZ = 0
' size of text quad.
sizeX = 1
sizeZ = height(tex)/width(tex)
do
' scroll.
textZ = textZ + 0.001
' clear screen and render text as a single quad.
set color 0, 0, 0
cls
S3D_Clear()
S3D_Texture(tex)
S3D_Color(255, 255, 255)
S3D_RotateX(rad(40))
S3D_Translate(0, 0.5, textZ)
S3D_Begin(S3D_QUADS)
S3D_Vertex(-sizeX*0.5, 0, 0, 0, 0)
S3D_Vertex(sizeX*0.5, 0, 0, 1, 0)
S3D_Vertex(sizeX*0.5, 0, -sizeZ, 1, 1)
S3D_Vertex(-sizeX*0.5, 0, -sizeZ, 0, 1)
S3D_End()
S3D_Render()
S3D_RenderFog(0, 0, 0, false)
redraw
fwait 60
until keydown(KEY_ESCAPE, true)
Edit: A version higher texture resolution:
Code:
include "s3d.n7"
set window "Cool text", 640, 480, false
set redraw off
' create font and a texture (image).
set font createfont("arial", 31, true)
tex = createimage(512, 1024)
' set target image to the one we created and write some
' text to it.
set image tex
set color 255, 200, 0
set caret 256, 0
center "Episode VII"
set caret 0, fheight()*2
for i = 0 to 28 wln "This is text. This is text. This is text. Yes."
wln "The end."
' set image to primary (window) again.
set image primary
' Init s3d.
S3D_SetView(primary, rad(90), 0.1, 1.5)
S3D_SetPerspectiveCorrection(S3D_NORMAL)
' text z, scroll value.
textZ = 0
' size of text quad.
sizeX = 1
sizeZ = height(tex)/width(tex)
do
' scroll.
textZ = textZ + 0.001
' clear screen and render text as a single quad.
set color 0, 0, 0
cls
S3D_Clear()
S3D_Texture(tex)
S3D_Color(255, 255, 255)
S3D_RotateX(rad(40))
S3D_Translate(0, 0.5, textZ)
S3D_Begin(S3D_QUADS)
S3D_Vertex(-sizeX*0.5, 0, 0, 0, 0)
S3D_Vertex(sizeX*0.5, 0, 0, 1, 0)
S3D_Vertex(sizeX*0.5, 0, -sizeZ, 1, 1)
S3D_Vertex(-sizeX*0.5, 0, -sizeZ, 0, 1)
S3D_End()
S3D_Render()
S3D_RenderFog(0, 0, 0, false)
redraw
fwait 60
until keydown(KEY_ESCAPE, true)