Difference between revisions of "User:Michel Lemmon/Script Presentazione"

From Second Life Wiki
Jump to navigation Jump to search
(New page: {| width="100%" |- |valign="top"| <div id="box"> ==Script Crea Presentazione Slide con Texture v0.2== <div style="padding: 0.5em"> Questo script vi permette di creare in-world attraverso u...)
 
m (added to category)
 
(2 intermediate revisions by one other user not shown)
Line 3: Line 3:
|valign="top"|
|valign="top"|
<div id="box">
<div id="box">
==Script Crea Presentazione Slide con Texture v0.2==
==Script Crea Presentazione Slide Show con Texture==
<div style="padding: 0.5em">
<div style="padding: 0.5em">
Questo script vi permette di creare in-world attraverso un oggetto uno slide show. Rezzare un cubo, mettere le texture nel cubo che vogliamo usare per la nostra presentazione (Slide Show). Creare nei content dell'oggetto un '''New Script''' e copiate lo script che vedete qui sotto all'interno dello stesso cubo. Se numerate le vostre texture le stesse verranno presentate nel ordine definito.   
Questo script vi permette di creare in-world attraverso un oggetto uno slide show. Rezzare un cubo, mettere le texture nel cubo che vogliamo usare per la nostra presentazione (Slide Show). Creare nei content dell'oggetto un '''New Script''' e copiate lo script che vedete qui sotto all'interno dello stesso cubo. Se numerate le vostre texture le stesse verranno presentate nel ordine definito.   
Line 12: Line 12:
string __version_id = "Script Presentazione Slide Show v 0.2";
string __version_id = "Script Presentazione Slide Show v 0.2";


// global variables
// Variabili Globali
integer interval;
integer interval;
integer currentTexture = 0;
integer currentTexture = 0;
Line 106: Line 106:
         if (totalTextures > 0) {
         if (totalTextures > 0) {


             // Ensure that we do not go out of bounds with the index
             // Assicurarsi che che l'index non esca dai limiti
             if (currentTexture >= totalTextures) {
             if (currentTexture >= totalTextures) {
                 currentTexture = 0;
                 currentTexture = 0;
Line 140: Line 140:
|}
|}
[[User:Michel Lemmon|Michel Lemmon]] 20:00, 1 april 2008(PST)
[[User:Michel Lemmon|Michel Lemmon]] 20:00, 1 april 2008(PST)
[[category:Pagine italiane da wikificare]]

Latest revision as of 13:07, 1 November 2009

Script Crea Presentazione Slide Show con Texture

Questo script vi permette di creare in-world attraverso un oggetto uno slide show. Rezzare un cubo, mettere le texture nel cubo che vogliamo usare per la nostra presentazione (Slide Show). Creare nei content dell'oggetto un New Script e copiate lo script che vedete qui sotto all'interno dello stesso cubo. Se numerate le vostre texture le stesse verranno presentate nel ordine definito.

Cliccare sul cubo per attivare lo SlideShow. Vi appare un menu con tutte le opzioni per gestire lo Slide Show. <lsl>// integer __debug = FALSE; string __version_id = "Script Presentazione Slide Show v 0.2";

// Variabili Globali integer interval; integer currentTexture = 0; integer previousTexture = 0; integer totalTextures = 0; list textureList =[]; integer messageChannel = 999888; list dynMenu =["Indietro", "Versione", "Avanti", "Reset"];

// Qui trovate la lista delle costanti possibili. list list_types = [INVENTORY_NONE, INVENTORY_TEXTURE, INVENTORY_SOUND, INVENTORY_LANDMARK,

                  INVENTORY_CLOTHING, INVENTORY_OBJECT, INVENTORY_NOTECARD, INVENTORY_SCRIPT,
                  INVENTORY_BODYPART, INVENTORY_ANIMATION, INVENTORY_GESTURE];

// Qui trovate la lista delle stringhe corrispondenti. list list_names = ["None", "Texture", "Sound", "Landmark", "Clothing", "Object", "Notecard",

                  "Script", "Body Part", "Animation", "Gesture"];

default {

   state_entry() {
       // Leggi le texture nel prim e salvale
       integer typeCount = llGetInventoryNumber(INVENTORY_TEXTURE);
       integer j;
       for (j = 0; j < typeCount; ++j) {
           string invName = llGetInventoryName(INVENTORY_TEXTURE, j);
           if (__debug) {
               llWhisper(0, "Inventory " + invName);
           }
           textureList += invName;
           ++totalTextures;
       }
       if (__debug) {
           llWhisper(0, "Found " + (string) totalTextures + " textures");
       }
       llSetTexture(llList2String(textureList, 0), 0);


       // inizializza il canale dove lo SlideShow comunica con l'owner via dialog
       messageChannel = (integer) llFrand(2000000000.0);
       llListen(messageChannel, "", NULL_KEY, "");
       // llOwnerSay((string)messageChannel);
       currentTexture = 0;
   }
   on_rez(integer start_param) {
       llResetScript();
   }


   touch_start(integer total_number) {
       if (llDetectedKey(0) == llGetOwner()) {
           llDialog(llDetectedKey(0), "Cosa vuoi fare?", dynMenu, messageChannel);
       }
   }
   // Ascolta il messaggio dialog box e risponde in modo appropriato
   listen(integer channel, string name, key id, string message) {
       if (id != llGetOwner()) {
           return;
       }
       if (message == "Versione") {
           llWhisper(0, __version_id);
           return;
       }
       if (message == "Reset") {
           llResetScript();
       }
       if (message == "Indietro" && currentTexture > 0) {
           previousTexture = currentTexture;
           --currentTexture;
       } else if (message == "Avanti" && (currentTexture >= 0) && (currentTexture < totalTextures)) {
           previousTexture = currentTexture;
           ++currentTexture;
       } else {
           llDialog(llGetOwner(), "Cosa vuoi fare?", dynMenu, messageChannel);
           return;
       }
       // Se ci sono Texture da applicare.  In caso contrario non fare niente.
       if (totalTextures > 0) {
           // Assicurarsi che che l'index non esca dai limiti
           if (currentTexture >= totalTextures) {
               currentTexture = 0;
           }
           // Setta le nuove texture
           llSetTexture(llList2String(textureList, currentTexture), 0);
           // Setta a 3 secondi il tempo di visualizzazione delle texture
           llSetTimerEvent(3.00);
           llDialog(llGetOwner(), "Cosa vuoi fare?", dynMenu, messageChannel);
       }
   }
   timer() {
       // Elimina tutti gli eventi timer precedenti
       llSetTimerEvent(0.00);
       // Setta la prossima texture in pre-cache
       integer nextTexture = currentTexture + 1;
       if (nextTexture >= totalTextures) {
           nextTexture = 0;
       }
       llSetTexture(llList2String(textureList, nextTexture), 1);
   }

}</lsl>

Michel's Informazioni
Michel Lemmon2.jpg
Click per Ingrandire


Link VTeam

Michel Lemmon 20:00, 1 april 2008(PST)