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.

Dark GDK / Displying Scrolling Text.

Author
Message
steakyfask
13
Years of Service
User Offline
Joined: 9th Jan 2011
Location:
Posted: 23rd Aug 2011 07:11
How Would you Display Text using DarkGDK in a typical RPG style such as, a box appears on the screen and the text seems to paste to the screen letter by letter.

like Final fntasy 7....
http://www.youtube.com/watch?v=He0Uw-4V5iY&feature=related
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 23rd Aug 2011 22:51
With timing and indexes. Make a text class that holds the string to be displayed, and it has an index to indicate how far along the string you are (the last character to display). The class should be updated every loop with the elapsed time, and if the time is greater than the "typing time", then increase the index to the next character. Then go through the string from the beginning until the index and display the letters (or copy the partial string to another string and display that as a whole).

It's really not difficult to figure out, but the exact implementation takes some work, and it depends on how you want to display the letters (with characters or with bitmaps, for example).
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 23rd Aug 2011 23:31
Here's a crude example to get you started, but this needs further development to be usable in a real application. I didn't even make a timer, just reduced the frame rate to manage the typing speed.

Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 24th Aug 2011 07:45
Here is an updated example with elapsed time handling, in this one I didn't need to reduce the frame rate. You can control the speed with the TYPING_TIME constant.



If you do include such an effect in a game, I would say make it optional, because not everybody likes it. It's a nice effect in a few cut-scenes, but to watch it throughout the whole game gets annoying and tiring for the eyes in my opinion, especially if the text is long.
steakyfask
13
Years of Service
User Offline
Joined: 9th Jan 2011
Location:
Posted: 25th Aug 2011 05:13
Thank you, that keep me busy for some time playing around .

erm how do you start a new line every so many words? I can't get it working right.


Quote: "If you do include such an effect in a game, I would say make it optional, because not everybody likes it. It's a nice effect in a few cut-scenes, but to watch it throughout the whole game gets annoying and tiring for the eyes in my opinion, especially if the text is long. "



Do you mean the typing syle replicated using your code? most rpgs I have played have this style of text and I never noticed it being annoying, Its like it the whole way thoughtout all the Final fnatasys.

also could you recommend any good books, either using darkGDK (if any?) or good C++ books. I'm a bit of a noob at programming.
steakyfask
13
Years of Service
User Offline
Joined: 9th Jan 2011
Location:
Posted: 25th Aug 2011 06:01
Ha... I can use "\n" in my string i type. or is there a better way ?
WLGfx
17
Years of Service
User Offline
Joined: 1st Nov 2007
Location: NW United Kingdom
Posted: 25th Aug 2011 13:13
http://www.loirak.com/prog/ctutor.php Is a link to noob C tutorials and looks rather a good start for anyone getting started. C++ has made a lot of extensions on the C language but here you will get a good start understanding it.

Warning! May contain Nuts!
Mireben
16
Years of Service
User Offline
Joined: 5th Aug 2008
Location:
Posted: 25th Aug 2011 22:42 Edited at: 25th Aug 2011 23:50
You can find C++ references here:

http://www.cplusplus.com/doc/tutorial/

http://www.learncpp.com/

There are also good books about C++, but most of those that I could recommend are probably too advanced yet for you. On the basic level, I found the "teach yourself C++ in 24 hours" book a good introduction. (It focuses on explanation rather than on exercises, though.)

About programming with Dark GDK, there is the so-called "Gaddis book": "Starting Out with Games & Graphics in C++". I don't know how good it is, I've seen only two or three exercises from it, when people using the book posted on the forum. It was advertised in the TGC newsletter once.

http://www.thegamecreators.com/pages/newsletters/newsletter_issue_88.html

However, you can learn Dark GDK from the tutorials, code examples, your own experiments and reading the forum, so a book is not absolutely necessary.

P.S. If you look around in internet book stores and read the reader reviews about C++ books, you can probably judge which would be worth to get.

Login to post a reply

Server time is: 2024-11-19 08:36:11
Your offset time is: 2024-11-19 08:36:11