Difference between revisions of "User:Kephra Nurmi/lsDisplay"
Jump to navigation
Jump to search
Kephra Nurmi (talk | contribs) |
Kephra Nurmi (talk | contribs) (update 10321 = 2010 nov 17) |
||
Line 4: | Line 4: | ||
Just drop the script into a prim, resize X, and drop your pictures into the prims content. | Just drop the script into a prim, resize X, and drop your pictures into the prims content. | ||
=== Script .lsDisplay simple | === Script .lsDisplay simple 10321 === | ||
<lsl> | <lsl> | ||
// .lsDisplay simple | // .lsDisplay simple 10321 (c) Kephra Nurmi 2007 | ||
// published under Creative Commons Attribution-Share Alike 3.0 License | // published under Creative Commons Attribution-Share Alike 3.0 License | ||
string name = ""; | string name = ""; | ||
integer pos = 0; | |||
integer random = FALSE; | |||
tick() { | tick() { | ||
if (name != "") { | if (name != "") { | ||
Line 17: | Line 19: | ||
llSetTexture(name, 3); | llSetTexture(name, 3); | ||
} | } | ||
integer choice; | |||
integer number = llGetInventoryNumber(INVENTORY_TEXTURE); | integer number = llGetInventoryNumber(INVENTORY_TEXTURE); | ||
if (!number) return; | if (!number) return; | ||
if (random) { | |||
choice = (integer)llFrand(number); | |||
} else { | |||
choice = pos; | |||
pos++; | |||
if (pos >= llGetInventoryNumber(INVENTORY_TEXTURE)) pos = 0; | |||
} | |||
name = llGetInventoryName(INVENTORY_TEXTURE, choice); | name = llGetInventoryName(INVENTORY_TEXTURE, choice); | ||
if (name != "") llSetTexture(name, 5); | if (name != "") llSetTexture(name, 5); | ||
} | } | ||
reshape() { | reshape() { | ||
vector size = llGetScale(); | vector size = llGetScale(); | ||
Line 31: | Line 39: | ||
llSetTexture(TEXTURE_BLANK, ALL_SIDES); | llSetTexture(TEXTURE_BLANK, ALL_SIDES); | ||
} | } | ||
default { | default { | ||
state_entry() { | state_entry() { | ||
Line 41: | Line 49: | ||
} | } | ||
timer() { | timer() { | ||
tick(); | |||
} | |||
touch_start(integer n) { | |||
tick(); | tick(); | ||
} | } |
Revision as of 14:17, 17 November 2010
LSL Portal | Functions | Events | Types | Operators | Constants | Flow Control | Script Library | Categorized Library | Tutorials |
The simple lsDisplay is a random picture cycler with a preloader on the inside of the prim. Just drop the script into a prim, resize X, and drop your pictures into the prims content.
Script .lsDisplay simple 10321
<lsl> // .lsDisplay simple 10321 (c) Kephra Nurmi 2007 // published under Creative Commons Attribution-Share Alike 3.0 License
string name = ""; integer pos = 0; integer random = FALSE;
tick() {
if (name != "") { llSetTexture(name, 1); llSetTexture(name, 3); } integer choice; integer number = llGetInventoryNumber(INVENTORY_TEXTURE); if (!number) return; if (random) { choice = (integer)llFrand(number); } else { choice = pos; pos++; if (pos >= llGetInventoryNumber(INVENTORY_TEXTURE)) pos = 0; } name = llGetInventoryName(INVENTORY_TEXTURE, choice); if (name != "") llSetTexture(name, 5);
}
reshape() {
vector size = llGetScale(); llSetPrimitiveParams([PRIM_TYPE, PRIM_TYPE_BOX, PRIM_HOLE_SQUARE, <0.0, 1.0, 0.0>, 0.95, <0.0, 0.0, 0.0>, <1.0, 1.0, 0.0>, <0.0, 0.0, 0.0>]); llSetScale(<size.x, 0.01, size.x*2/3>); llSetTexture(TEXTURE_BLANK, ALL_SIDES);
}
default {
state_entry() { reshape(); llSetText("", <0,1,0>,1); tick(); tick(); llSetTimerEvent(60.0); } timer() { tick(); } touch_start(integer n) { tick(); } changed(integer change) { if (change & CHANGED_SCALE) reshape(); if (change & CHANGED_INVENTORY) tick(); }
} </lsl>
Ready to use lsDisplay Poster Cycler
You can pick a ready to use lsDisplay Poster Cycler in my home at [Apoda].