Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Type writer effect

Author
Message
chilledoutjohn
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 4th Jul 2004 06:59
Im sure ive seen it on the forum somewhere but after searching many a time i still cant find it can anyone point me in the direction of a peice of code that will allow me to type something in and when it apears on screen it will act as if a type writer had typed it. Bit of a weird one i know but if anyone can help id apreciate it

cheers
Sleet
21
Years of Service
User Offline
Joined: 3rd Aug 2003
Location:
Posted: 6th Jul 2004 12:39
what do you mean "act as though a typewriter had typed it"

as far as I know typewriter typed letters act the same way any other typed letters do........
DaedalusX
21
Years of Service
User Offline
Joined: 10th Mar 2004
Location:
Posted: 7th Jul 2004 02:25
printing letters seperatly one after the other like when u type. i dont know how to do it. i just have it come up as one untill i figure it out

Daedalus
Phaelax
DBPro Master
22
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 7th Jul 2004 12:41
you mean like "input r$"?

Or you mean typing while a game is still playing?

"eureka" - Archimedes
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 7th Jul 2004 18:19
try this:


by the way, what do you need this for?

cya later,
Axelman.

CURRENT PROJECT: Enemy At The Gates
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 8th Jul 2004 00:11
Ye can try this:



Just call this function:

typewrite("Test 1 2 3!", a, b, c)
a = X start location
b = Y start location
c = X between each letter

example:

typewrite("Test 1, 2, 3!!", 20,5,7)

CornStalks
21
Years of Service
User Offline
Joined: 12th Feb 2004
Location: Utah
Posted: 8th Jul 2004 01:20
hey, i think alexman's code would work the best, but if you want that big line thingy, you know the thing that is always in front of you letters and looks like a big lowercase l, i would try my code. just copy it into the editor and you will see...
I also made it look like sometimes the com is typing fast, and then slowing down like in reality. If you dont like that, set all the waits to the same time. And if you want the | to blink, just erase it in some of the lines

of corse, it does take a while and a lot of lines, but it looks cool!
please try my code, just copy it, my fricken fingers are numb!

dang im hot...
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 8th Jul 2004 02:46
Lol, my code totally replaces that code

chilledoutjohn
21
Years of Service
User Offline
Joined: 10th Aug 2003
Location:
Posted: 8th Jul 2004 09:19
Ace cheers all i need it for an intro to a game >whach this space<
Axelman
21
Years of Service
User Offline
Joined: 18th Oct 2003
Location: Parallel Universe
Posted: 8th Jul 2004 11:00 Edited at: 8th Jul 2004 11:02
i don't understand your code baal. Please explain.
Quote: "for a=1 to len(t$)"

What is len?
and what is the value of t$?

CURRENT PROJECT: Enemy At The Gates
Emperor Baal
21
Years of Service
User Offline
Joined: 1st Dec 2003
Location: The Netherlands - Oudenbosch
Posted: 8th Jul 2004 19:40 Edited at: 8th Jul 2004 19:43
Well, first of all, its a function:



If we call it with these parameters:
typewrite("Test", 20, 20,7)

t$ would be "Test"
x would be 20
y would be 20
x2 would be 7

Then it will check if the text is bigger then 0 chars (if t$ <> "")

If its bigger, it will run into a loop:

for a=1 to len(t$)

Now if we replace len(t$):


for a=1 to 4
text x+x2*(a-1),y,mid$(t$,a)
wait 500
next a

It would run the text and wait command 4 times:

text 20,20,mid$(t$,1)
wait 500
text 27,20,mid$(t$,2)
wait 500
text 34,20,mid$(t$,3)
wait 500
text 41,20,mid$(t$,4)
wait 500


mid$ returns a character from a string:

mid$(string$, number)

So, if our string$ would be "ABCDEFG" and number would be 5
it would return: "E"

Pretty simple.
You can even add a sound effect for each letter



Hope it helps.

Login to post a reply

Server time is: 2025-05-25 07:14:19
Your offset time is: 2025-05-25 07:14:19