sami
08-31-2003, 06: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
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