Posts: 229
Threads: 27
Joined: Nov 2023
Reputation:
0
In Naalaa 5, we can make a moving text effect like in an old action / superhero movie like this :
click the image to zoom in
How to do the same effect in N7 ?
Posts: 361
Threads: 40
Joined: Nov 2023
Reputation:
3
12-08-2024, 05:49 PM
(This post was last modified: 12-09-2024, 05:11 AM by johnno56.
Edit Reason: N7 NOT M7
)
You have a working version of N5? How cool is that? But, if you have to ask "how" to do this using N7, chances are that this is a screen image and you are unable to "read" the program... Either way... it's still a cool effect. Commonly known as, and please forgive the bad language, the Star Wars Crawl... I too would like to know how this is done... lol
Logic is the beginning of wisdom.
Posts: 74
Threads: 4
Joined: Dec 2023
Reputation:
4
If you have a look in the examples/other folder for N7 there is an asteroids game. I have used a similar effect for shrinking text at the end of the introduction screen, which may help - it should be easy enough to move the text up the screen also. If this is the route to follow, I'd suggest yoiu look at the S3D library, where the effects are more efficient.
All the best - Kevin.
Posts: 229
Threads: 27
Joined: Nov 2023
Reputation:
0
I'm amazed the Naalaa 5 code to achieve the star wars crawling text effect is only 35 lines !
I still have Naalaa 5, Naalaa 6, and of course Naalaa 7 on my computer
Code: rem ==================================================================
rem Mode 7 - Bonus example.
rem
rem By Marcus.
rem ==================================================================
rem Import libraries.
import "Mode7.lib"
import "Speed.lib"
rem Set window.
set window 16, 16, 512, 384, false, 1
set redraw off
rem Init mode 7.
proc M7_Init width(primary), height(primary), 3.0
rem Load map.
flags[][] = M7_LoadMap("m7_data/starwars_map.txt")
if sizeof(flags) = 0 then end
rem Change fog.
proc M7_SetFog 0, 0, 0, 1.0, 3.0
z# = 0.5
do
z = z + 0.008
set color 0, 0, 0
cls
proc M7_Render 0.5, z, 0.4, 270.0, -128, 70.0
redraw
proc SPD_HoldFrame 10
until z > 5.5 or keydown(27) or not running()
Posts: 359
Threads: 42
Joined: Nov 2023
Reputation:
3
It would certainly be possible to write something using just the 'draw hraster' command and some maths. The mode7 library in n5 and n6 used that. But it's probably easier with s3d. I'll see if I can put something together!
Posts: 359
Threads: 42
Joined: Nov 2023
Reputation:
3
12-09-2024, 05:41 PM
(This post was last modified: 12-09-2024, 06:08 PM by Marcus.)
Here you go
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)
Posts: 361
Threads: 40
Joined: Nov 2023
Reputation:
3
Very cool indeed... S3D? Cool...
Logic is the beginning of wisdom.
Posts: 229
Threads: 27
Joined: Nov 2023
Reputation:
0
@Marcus ... Thank you for the cool text effect.... I'm thinking to make a sequel of The Star Trek https://www.naalaa.com/forum/thread-149.html and use your S3D cool text effect. Awesome !
@Kevin ...You used "wireframed" polygon texts and animated them in the old "Astreroid". Cool !
@Johnno...The oldest version of Naalaa that I have is version 5, for the sake of auld lang syne , I am searching for the oldest version of Naalaa too.
Posts: 361
Threads: 40
Joined: Nov 2023
Reputation:
3
If memory serves correctly, version 3 (widows only), was the first public version of Naalaa.... could be as far back as about 2011... but I could be wrong... lol
Logic is the beginning of wisdom.
Posts: 229
Threads: 27
Joined: Nov 2023
Reputation:
0
(12-10-2024, 06:02 AM)johnno56 Wrote: If memory serves correctly, version 3 (widows only), was the first public version of Naalaa.... could be as far back as about 2011... but I could be wrong... lol
Hi, I found the download link of Naalaa 3 https://naalaa.software.informer.com/3.0/ the developer was Naalaa Creator (It reminds me of someone from the very old time ...).
click the image to zoom in
... but I hesitated to push the green download button, virus software ? bat trap ? whack-a-mole ?
|