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.

Code Snippets / 'End credits'-style Text Scroller (DBP)

Author
Message
Codelike
20
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 21st Dec 2005 14:20
Here's the scroller wot I woz planning...
EZPZ & useful for everyone's games!




I have an XP3000+, 1.5gb DDR333, a 6600GT and I'm programming 3k text-based exe's?!
Codelike
20
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 21st Dec 2005 21:07
And the same thing using an array...



I have an XP3000+, 1.5gb DDR333, a 6600GT and I'm programming 3k text-based exe's?!
Codelike
20
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 22nd Dec 2005 14:11
Hold on a minute! I don't want to have to change loads of 7's if I wish to add another line to the array. Let's make it a little more dynamic & put the 7's all in one place.



Ok. So now the array can be expanded easily & with just the 'size=' needing to be altered.

I have an XP3000+, 1.5gb DDR333, a 6600GT and I'm programming 3k text-based exe's?!
Sven B
21
Years of Service
User Offline
Joined: 5th Jan 2005
Location: Belgium
Posted: 22nd Dec 2005 14:20
Why do you use the sizevar. You can use DBP command "array count()" to get the number of elements in an array.
Codelike
20
Years of Service
User Offline
Joined: 13th Dec 2005
Location: DBP - Scouseland
Posted: 22nd Dec 2005 20:10
A good point there Sven! I missed that command.

I could do the same thing with the 'px=' & change it to...
px=text height(text$(t))

I'm also going to tidy up the 'for x=' line as well.
I hope it's much easier to quickly edit the output now!

It's very interesting how these things develop & take on a life of their own. There's also the point of how several different codes can produce exactly the same thing, but can work clumsily or in a more refined manner!





I have an XP3000+, 1.5gb DDR333, a 6600GT and I'm programming 3k text-based exe's?!
Element
23
Years of Service
User Offline
Joined: 14th Dec 2002
Location: United States
Posted: 9th Feb 2006 10:06
This is a great snippet.

If you have a problem with the snippet bunching up all your text into one line, I found a bug withen the code, but I have a pseudo solution for it. You'll have to put some kind of entry in the first array to prevent this from happening.

bug example: text$(0)=""

will bunch up all lines of text into just 1 line that scrolls

solution example: text$(0)=" "

just add a space or whatever you want if you don't want any text in the first array and this will fix the problem you are having.

Hope this helps a bit.


Thanks for the snippet, Codelike.

TLoK=The Legend of Kilpatrick
http://www.thelegendofkilpatrick.com
New RPG game coming to you from GP Interactive

Login to post a reply

Server time is: 2026-06-11 09:56:17
Your offset time is: 2026-06-11 09:56:17