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 / Text-wrapping demonstration - free to use...

Author
Message
jwurmz
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Arizona, USA
Posted: 6th Mar 2005 07:45 Edited at: 8th Mar 2005 07:23
Here's a text wrapping program that is a part of a larger project of mine. It accepts a string of any font style or size, the x and y location of the string, and a text width limiter value to determine when to wrap text. It also calculates and draws a bounding box around the text. Then you can paste the new, soon to be better text anywhere the mouse is located by pressing enter or left click. Press spacebar or right click to reset everthing.



The code is free for anyone to use and/or learn from. Right now, most everything is randomly generated, but can easily be tailored to suit most needs. Just set rp$ to whatever and same with tx, ty, tw, etc..

Comments and suggestions are welcome too...

"Creativity is knowing how to hide your sources" - Einstein
jwurmz
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Arizona, USA
Posted: 7th Mar 2005 12:51 Edited at: 8th Mar 2005 07:40
[UPDATED PROGRAM]

It now uses memblocks to copy old text and paste text according to random alpha generated each run. I'm going to try and use this concept to code special text effects.... any ideas???

here's negative blended text:


and further down the post is an alphablended pic...

"Creativity is knowing how to hide your sources" - Einstein

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 7th Mar 2005 20:55
Looks nice. One thing it will certainly do is make your project look less like a home-grown DB Pro project, 'cos DB Pro doesn't do text very well. (Not that it should).

Nice work. The alpha fading makes it look better, too.

BatVink
jwurmz
21
Years of Service
User Offline
Joined: 6th Oct 2003
Location: Arizona, USA
Posted: 8th Mar 2005 07:16 Edited at: 8th Mar 2005 07:21
No home grown? But thats right up my alley...

Anyhow, what do you find bad about dbpro's text? classic wasn't any better as far as i remember. For that matter, why shouldn't DBPro have decent text?

I made a little more progress on it. It's turning into a project in and of itself rather than an add-in (maybe should move to WIP board). Also, I was sick of looking at randomly generated jibberish, so i pulled a paragraph or two from the DBPro help files to use for the text wrapping.

That aside, here's an updated screenshot that shows some visual improvements:


"Creativity is knowing how to hide your sources" - Einstein

Attachments

Login to view attachments
BatVink
Moderator
21
Years of Service
User Offline
Joined: 4th Apr 2003
Location: Gods own County, UK
Posted: 8th Mar 2005 23:15
Quote: "Anyhow, what do you find bad about dbpro's text"


It's just a little limited. No word-wrapping (hence your project!), minor problems with SYNCing, slow to change styles and sizes, and very plain. But then DB is a game maker, not a word processor.

BatVink

Login to post a reply

Server time is: 2024-11-23 14:11:26
Your offset time is: 2024-11-23 14:11:26