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 / Finally, a decent textbox function!

Author
Message
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 18th Apr 2004 15:35
Here is my day's work on a nice command used to display text in a custom drawn box, prefferably used for talking in rpgs. This is how it's used:

textbox(textstring$,xpos,ypos,endxpos)

textstring$: The text in the box.
xpos: The x position (duh!)
ypos: The y position
endxpos: The maximum x position

Currently it works only by letters, but im trying to make it word based, so it doesnt split the text into pieces. The box will stretch down to how much space is needed to display the text. Im also gonna make it sort of 3d based, so that it follows the person talking. Anyway, I've said enough, tell me what you think

The image used with it:
http://sephiroth7769.tripod.com/sitebuildercontent/sitebuilderpictures/textbox.bmp



.........what's the point of reading this?
Van B
Moderator
21
Years of Service
User Offline
Joined: 8th Oct 2002
Location: Sunnyvale
Posted: 18th Apr 2004 15:45
Pretty cool - maybe you could get him to make a paste image version too for non-3d stuff (sprites force 3D mode).


Van-B


The nature of Monkey was irrepressible!.
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 18th Apr 2004 15:52
There'd be only one problem with that, too many images. In this version, you have one image(that can be easily modified), instead of 9 images that need too be loaded and edited seperately. But there might be a way around this, i'll see what i can do

.........what's the point of reading this?
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 19th Apr 2004 09:01
Wow, some tough coding, but it's almost complete. This time I made it scroll(like the one in ff9), and it deosnt go through the sides of the screen. move it with the mouse, leftclick=bigger, rightclick=smaller. Hope you like it

Same pic as last time:
http://sephiroth7769.tripod.com/sitebuildercontent/sitebuilderpictures/textbox.bmp

And a speechbubble thingy:
http://sephiroth7769.tripod.com/sitebuildercontent/sitebuilderpictures/talk.bmp



Its a little slow, but i think thats because of 'text'. You can try making image/sprite based text, and that should make it faster.

.........what's the point of reading this?
Guldan the Warlock
20
Years of Service
User Offline
Joined: 18th Feb 2004
Location: Azeroth
Posted: 21st Apr 2004 06:32
Awsome, I can use this in the game I'm working on. I'll credit you of course. Thanks a bunch!
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 21st Apr 2004 10:14
Wait Guldan, im still gonna update it, probably today. Actually i might as well work on it now...

.........what's the point of reading this?
NathanF
20
Years of Service
User Offline
Joined: 24th Mar 2004
Location:
Posted: 21st Apr 2004 11:27
This should be my last update. Im gonna give up on the word thing, there seems to be no way to get it working. In this version, it reacts to all 4 sides of the screen. Ive also included a little 3d world, so that you can see how to use it. Tell me if you like it, or what can be improved(apart from the word seperating). Enjoy

the new image for the textbox(just a bit better looking) :
http://sephiroth7769.tripod.com/sitebuildercontent/sitebuilderpictures/textbox2.bmp



.........what's the point of reading this?
Atreides
20
Years of Service
User Offline
Joined: 11th Oct 2003
Location: Switzerland (but NOT on a mountain !)
Posted: 22nd Apr 2004 19:27
hmm.. when I read "text box", I thought it was something like a "type='input'" in HTML..
I wrote one and thought it would be well to see one and improve mine or give ideas...


but I see that you've problems to cut your text.. I don't know if you've repaired that since the first version, I don't have enough time to look at the latest version.. I had a similar problem when I made pseudo-windows in an application...
Here's my code that cut the text, that may give you ideas



yeah, I know, my code is ugly and hard to read... but it works... I should use more comments

The sleeper must awaken !
Rassler
20
Years of Service
User Offline
Joined: 22nd Apr 2004
Location:
Posted: 23rd Apr 2004 01:54 Edited at: 23rd Apr 2004 01:55
your web site seems to be unavailable at the moment. It asked me if I was the owner and told me how to create a web page. I thought you might be a bit cross with me if I did, so I didn't.

Note. The 'DarkBasic' in my email is only so I can seperate my emails. Don't go thinking I'm a clever mega brain who wrote any of this stuff.

Login to post a reply

Server time is: 2024-05-12 15:06:38
Your offset time is: 2024-05-12 15:06:38