PDA

View Full Version : Dev Tool: Cool New script: SuperText! check it out...and help me plz! ;-)



sami
08-31-2003, 05:59 PM
Hey all,

Check this out. I think this script could be quite useful to other LScript developers (**IF ONLY** some kind soul can help me get the dang thing into a useable library format :confused: - I can't get it to work with @insert OR library).

I call it ** SuperText ** which is, yup, you guessed it :p a "super" drawtext() with tons of icons, auto-linewrap(not word wrap yet), html BOLD and line breaks.

It consists of these functions:
================================================== ==

drawSuperText(message_String, X, Y, numCharsToWrapAt)

// this draws the messageString at the position X, Y auto-wrapping at the char# specified


drawHighlightedSuperText(message_String, X, Y, bgdColorVector, numCharsToWrapAt)

// this draws the messageString at the position X, Y auto-wrapping at the char# specified with a background
color highlight behind the text


GetTextBlockSize(message_String, numCharsToWrapAt)

// This sets a global variable (I had trouble crashing returning an array) with the width and height of the
textblock of the message_String you pass to it. The values go into:
TextBlock[TB_WIDTH] and
TextBlock[TB_HEIGHT]


//-------------------
Tags supported so far are hard line-breaks: <br>
Bold text: <b> like so...</b>
and a ton of icons like: <icon=ICON_LW_BONE>
(including LW Scene type icons etc.)

Here is the icon keyword list:
ICON_INFO,
ICON_QUES,
ICON_WARN,
ICON_CRIT,
ICON_SMILE,
ICON_FROWN,
ICON_SAVE,
ICON_OPEN,
ICON_EDIT,
ICON_CHECK,
ICON_DEGREES,
ICON_FRAC_HALF,
ICON_FRAC_THIRD,
ICON_FRAC_QUARTER,
ICON_FRAC_FIFTH,
ICON_FRAC_SIXTH,
ICON_FRAC_SEVENTH,
ICON_FRAC_EIGHTH,
ICON_FRAC_NINTH,
ICON_FRAC_2THIRDS,
ICON_FRAC_3QUARTERS,
ICON_BULLET,
ICON_BULLET_OUTLINE,
ICON_ARROW_N,
ICON_ARROW_NE,
ICON_ARROW_E,
ICON_ARROW_SE,
ICON_ARROW_S,
ICON_ARROW_SW,
ICON_ARROW_W,
ICON_ARROW_NW,
ICON_MEDIA_STOP,
ICON_MEDIA_REWIND,
ICON_MEDIA_BACK,
ICON_MEDIA_PLAY_BACKWARDS,
ICON_MEDIA_PAUSE,
ICON_MEDIA_PLAY,
ICON_MEDIA_NEXT,
ICON_MEDIA_FASTFORWARD,
ICON_MENU,
ICON_LW_ACTIVE,
ICON_LW_VISIBLE,
ICON_LW_LOCK,
ICON_LW_EXPAND,
ICON_LW_COLLAPSE,
ICON_LW_OBJECT,
ICON_LW_BONE,
ICON_LW_LIGHT,
ICON_LW_CAMERA,
ICON_LW_HIDDEN,
ICON_LW_BOUNDINGBOX,
ICON_LW_VERTICES,
ICON_LW_WIREFRAME,
ICON_LW_FRONTFACE,
ICON_LW_SHADEDSOLID,
ICON_LW_TEXTURED,
ICON_LW_FALLOFF_UP,
ICON_LW_FALLOFF_DOWN,
ICON_LW_FALLOFF_UPDOWN,
ICON_LW_FALLOFF_DOWNUP


//*******-----------------------------------

Here it is (currently with a Modeler main() as a test to demonstrate it - since I can't seem to get it working in a library or as an @insert)...

Tell me what you think :cool: and any help is greatly appreciated. Once that's sorted I'll gladly put this out there for everyone to use in their scripts :)

http://animation.photonstudios.net/downloads/SuperText.ls


it requires 7.5c (LScript 2.6+)

cheers,
sami

sami
07-04-2011, 09:50 PM
Does anyone happen to have this old source code for SuperText that I had at that link in the previous post? It's not on my server since I've moved hosting and I seem to have misplaced it over the years and only have the compiled library of it handy - I'd like to tweak it and improve it and use it for another script.

This is what it can do if you are curious:

http://i.imgur.com/h7lr1.jpg

Blochi
07-07-2011, 05:55 PM
In fact, I do.
Never used it as-is, but it served as wonderful inspiration. Thanks for sharing.

sami
07-07-2011, 10:34 PM
Awesome! You just saved me tons of time looking through old backup dvds and hard drives. Glad it was useful, but I'm sure it needs an upgrade and is not terribly clean code I imagine - I haven't seen it in years.

Btw, are you the one who made that excellent Thickener script? Thanks, that was very very useful on occasion!

Blochi
07-14-2011, 05:52 PM
Hehe, yeah, thanks. Thickener was by far the simplest script ever, yet it's been my big hit.