G General

Text String on Prims Version 1

Text String on Prims
Details
Features
Contents
Reviews

Click the "Watch it in Action" above. As many characters and rows (lines) as you want. Your text.

If you use these scripts for development, please don't transfer them as modifiable. Please send people here instead.

To use scripts, you are expected to know the fundamentals of LSL scripting.

These scripts (and provided mesh prims) allow for the easy printing of ASCII text. ASCII is what's on a USA typewriter or the characters (non-control) on a USA keyboard. Characters for this are mono-spaced.

You can put this text on any linkset, and you can make it any size, position, and rotation you like on this linkset. Alternatively, you can just use it like a whiteboard (but you will need one extra prim to serve as the root).

There are front-end functions you can include in your script(s), and there is a back-end script that provides support for printing this ASCII text. The back-end should just be compiled and included in the root of your linkset.

As some brief notes about what happens when you're done:
* You will get a flat area for your text.
* Without any rotation, if you stand to the South of it and look North, you will see your text.
* In all but the South facing direction, the text board area is transparent. You will need other prims in the linkset if you wish to change this.

The following functions are available to you (i.e., the front-end):

SetupText: Must be called first, probably in the state_entry event of your main script.

TextColor: Used to set the color of the characters. They're initially black.

BackColor: Used to set the background where the characters are printed. Initially white.

ClearAllText: Just erases any text you've previously printed (or the setup text).

ShowNewText: Shows new text, deleting any prior text.

ShowNewTextAndBreakAtSpaces: Shows new text, deleting any prior text. This one attempts to break the rows on spaces for nice reading.

ShowTextAt: This one is used to print text without deleting your prior text. It's similar to llListReplaceList but with the characters on your board.

------------------------------

All but SetupText should be fairly intuitive. SetupText is best called in the state_entry event of your main script. Also, it's advisable to re-compile the script with the SetupText call if/when new prims are added to the linkset. The arguments to SetupText are:

vLocalPos: Position (center) of entire text area relative to your linkset (not the region). The text is along the X axis. Use ZERO_VECTOR if you're not sure.

qLocalRot: Rotation of entire text area relative to your linkset (not the region). Just use ZERO_ROTATION to start.

iRowsOfText: The number of rows (lines) of text you'd like.

iCharactersPerRow: Characters max per each row (line) of text.

fRowHeight: Height of each row of text (meters). So, total text height might be: fRowHeight * iRowsOfText.

fTextWidth: Width of one complete row of text (meters) for all the iCharactersPerRow.

fMargin: An amount for a margin. It's applied separately on all four sides of your text board.

---

Overall width will be: fTextWidth + fMargin * 2
Overall height will be: fRowHeight * iRowsOfText + fMargin * 2

---

For SetupText to work correctly, there are some rules:

1. The iCharactersPerRow MUST be a multiple of 8. The following are valid: 8, 16, 24, 32, 40, etc. Others will not work.

2. You MUST have the correct number of 8 sided mesh prims in the linkset for this to work. You were supplied with one full-perm 8 sided mesh prim. You must typically make copies and link them to your linkset. If you've lost your 8 side prim, you can get another copy for free ( https://marketplace.secondlife.com/p/Mesh8FacesForText/18087531 ). To figure out how many 8 sided prims you'll need, divide your iCharactersPerRow by 8. We'll call this "CharGroups". The number of 8 sided mesh prims you'll need is CharGroups * iRowsOfText. So, for example, if you want 7 rows, with 24 characters per row, you must have 21 linked mesh prims ( (24/8) * 7 ). It doesn't matter what they're named in your linkset.

As a further note, these 8 sided mesh prims must be made of "Plastic". This is how they should be when you get them. If you happen to have another mesh prim in the linkset with exactly 8 faces made of "Plastic", please change the material of your other mesh.

3. You must have one box prim with a name of "Back" (no quotes, but with capital B) in the linkset. Just a standard box, freshly rezzed is best.

4. None of the prims mentioned above can be the root. This would be any of the 8 sided mesh prims and the "Back" prim. If you just want a simple whiteboard, add one extra prim as the root. You can even make the root prim invisible if you like. That's up to you. There's no problem if your script(s) with these functions is in the root ... in fact, that's best. You can have as many other prims in your linkset as you like, and they will be ignored by these text functions.

---

Enjoy,
Kyle Flynn