OsSetPrimitiveParams
From OpenSimulator
(Difference between revisions)
Line 6: | Line 6: | ||
</source> | </source> | ||
| | | | ||
− | ossl_example = | + | ossl_example = <source lang="lsl"> |
+ | // change target_uuid to any uuid of the prim you wish to change visibility by clicking. | ||
+ | string target_uuid = "69031c69-36a5-4031-bdc8-8ca8c37f8eda"; | ||
+ | vector default_color; | ||
+ | |||
+ | default | ||
+ | { | ||
+ | state_entry() | ||
+ | { | ||
+ | list prim_params = osGetPrimitiveParams(target_uuid, [PRIM_COLOR, ALL_SIDES]); | ||
+ | default_color = llList2Vector(prim_params, 0); | ||
+ | } | ||
+ | |||
+ | touch_start(integer number) | ||
+ | { | ||
+ | list rules = [PRIM_NAME, "HIDDEN", PRIM_COLOR, ALL_SIDES, default_color, 0.0]; | ||
+ | osSetPrimitiveParams(target_uuid, rules); | ||
+ | state alpha; | ||
+ | } | ||
+ | } | ||
+ | |||
+ | state alpha | ||
+ | { | ||
+ | touch_start(integer number) | ||
+ | { | ||
+ | list rules = [PRIM_NAME, "VISIBLE", PRIM_COLOR, ALL_SIDES, default_color, 1.0]; | ||
+ | osSetPrimitiveParams(target_uuid, rules); | ||
+ | state default; | ||
+ | } | ||
+ | } | ||
+ | </source> | ||
| | | | ||
additional_info = * Sets the parameters for the prim specified by '''prim_uuid''' according to '''rules'''. | additional_info = * Sets the parameters for the prim specified by '''prim_uuid''' according to '''rules'''. |
Revision as of 20:26, 24 June 2011
osSetPrimitiveParams(key prim_uuid, list rules); | |
No descriptions provided | |
Threat Level | High |
Permissions | No permissions specified |
Extra Delay | No function delay specified |
Example(s) | |
// change target_uuid to any uuid of the prim you wish to change visibility by clicking. string target_uuid = "69031c69-36a5-4031-bdc8-8ca8c37f8eda"; vector default_color; default { state_entry() { list prim_params = osGetPrimitiveParams(target_uuid, [PRIM_COLOR, ALL_SIDES]); default_color = llList2Vector(prim_params, 0); } touch_start(integer number) { list rules = [PRIM_NAME, "HIDDEN", PRIM_COLOR, ALL_SIDES, default_color, 0.0]; osSetPrimitiveParams(target_uuid, rules); state alpha; } } state alpha { touch_start(integer number) { list rules = [PRIM_NAME, "VISIBLE", PRIM_COLOR, ALL_SIDES, default_color, 1.0]; osSetPrimitiveParams(target_uuid, rules); state default; } } | |
Notes | |
* Sets the parameters for the prim specified by prim_uuid according to rules.
|