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.

Newcomers DBPro Corner / Teletype Teletypng Effect One letter at a time typing to the screen

Author
Message
Nights Bane
14
Years of Service
User Offline
Joined: 15th Dec 2009
Location:
Posted: 3rd Jun 2010 04:48
Writing some demo code that does a teletype effect i.e) Text that prints to the screen one letter at a time, which could be useful for a little information text box. I tried searching the forums for something I could already use, but had no joy, and instead found something in the original db documentation! Thats gotta be a first no?

Anyway- the code either runs too fast or there is some other runtime error, as it is not displaying very well, i\'ve remarked the place I\'ve tried hammering some timer stuff into(to delay it) but it still just displays then disappears immediately.. I dont know whether it is just scrolling up on the y axis too fast or whatever.

Anyway, of to bed now, someone give us a hand. I\'m sure this will make a useful addition to the codebase if we get it working, I\'ll even turn it into a function when the bugs are squished.

Cheers in advance.

luskos
17
Years of Service
User Offline
Joined: 28th Jun 2007
Location:
Posted: 3rd Jun 2010 12:04
Try search type writer in the forums you can find somethig usefull.

Where there is a will, there is a way.
I often edit my posts, that`s who i am
CGray
14
Years of Service
User Offline
Joined: 28th May 2010
Location:
Posted: 4th Jun 2010 01:52
I remember making this up in GML a while back, and funnily enough all the examples lacked the same thing; no end of line detection.

Here's a quick one based on what I could remember. I'm making the assumption you don't want it to type while things are happening on screen, if so you'll need to find a way to update it in the game loop - probabbly something like:

if (timer > nextUpdateTime)
inc character space
display character
checkNewline
endif


Login to post a reply

Server time is: 2024-09-28 18:27:44
Your offset time is: 2024-09-28 18:27:44