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 / [DBP] - FPS style text alerter (multiple at once)

Author
Message
Broken_Code
13
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 1st May 2012 02:34
Here's a FPS-style text alerter, like the kind usually used to show you your objective; I'm not really sure what to call it! I called it a Scrolling Text Box or STB. These functions allow you to have as many as you want at a time. Anyway, here's the code:



So, remember to use the GoSub first to initiate the arrays and variables.
Here's the functions so far:
STBAdd - Add a scrolling text box to the screen, returns an ID you can use later
STBAddLine - Input the ID returned by STBAdd and the string will be added to the STB.
STBUpdate - You can call a specific STB ID or 0 to update all STBs

I'm going to update this to use Cloggy's D3D functions plugin as it's awesome but I don't have it on this computer yet but I'll update this thread when I've got it all sorted!

Feel free to take or modify this, and if you do modify it please post here so other people can benifit too!

Thanks,
BC
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st May 2012 05:57
Very interesting indeed

I will possibly build on this soon, thank you for sharing

Broken_Code
13
Years of Service
User Offline
Joined: 20th Aug 2010
Location: Bremen, Germany
Posted: 1st May 2012 19:34
I've re-written it to use D3D text and now lines of text also have a life time and will auto-erase as part of the update function. Also, this new version is just better than the old one!

Here's the functions:


Here's the code:


I'm going to re-add the 'direction' functionallity later.
Anybody got any ideas/requests that might make this more useful?

Thanks,
BC
MrValentine
AGK Backer
13
Years of Service
User Offline
Joined: 5th Dec 2010
Playing: FFVII
Posted: 1st May 2012 19:39 Edited at: 1st May 2012 19:40
yeah, link to the plugin might be helpful...

then I can test it out

EDIT

One of these days I will write a plugin for all browsers to replace all singular i's with I's...

jobromedia
11
Years of Service
User Offline
Joined: 9th May 2012
Location: Stockholm, Sweden
Posted: 27th May 2012 11:57
Could not understand command at line 9.
d3d_init

MIDI packs for sale.
Best regards
Johan Brodd
Phaelax
DBPro Master
20
Years of Service
User Offline
Joined: 16th Apr 2003
Location: Metropia
Posted: 2nd Jun 2012 17:51
Here's one I did awhile back, surprisingly its still around (8 years ago)

http://www.thegamecreators.com/?m=codebase_view&i=f3909b4271a5e7c3429bea281e1387f4

The main difference is that messages are only displayed for set amount of time unless otherwise bumped out by newer messages.

"You're not going crazy. You're going sane in a crazy world!" ~Tick

Login to post a reply

Server time is: 2024-03-28 19:18:44
Your offset time is: 2024-03-28 19:18:44