Build, Learn, Shop, Hangout
How To: Presentation viewer/slide show
The /presentation viewer/slide show. Has two modes, Auto and Manual. All settings are controlled through a simple dialog box. All you have to do is delete out the demo images in the viewer, put in your own images, then reset the system.
The slide show will run in alphabetical order, if you want a specific order, you will name accordingly. I recommend using something like a_PicName to get a sort that you want.
Auto Mode:
Automatically rotates through all images in the viewer. The default for Auto Mode is 5 seconds per slide. You can however, set the time to the following intervals.
2, 3, 5, 10, 15, 20, 30, 45, 60 (in Seconds
You can start, pause and stop the presentation.
Manual Mode:
You control the presentation, you can move forward and backwards through your presentation.
Switching modes:
Auto to Manual: Pause the presentation, then use the back and next normally.
Manual to Auto: Click Auto Start, it will wait the specified time, and then start rotating through the slides.
-
integer intCurTexture; //Current Texture
-
integer intInvNum; //Inventory Number
-
integer intRunning; //Script Status (1. Running, 0. Stopped)
-
integer intSlideDur; //Slide Duration
-
integer intDialog; //Dialog Channel
-
list lstMenu; //Dialog Menu
-
list lstMenuTime; //Dialog Time Menu
-
integer intAutoMan; //Type of Show (1. Auto, 2. Manual)
-
key keyMenuTouch; //Who Touched the menu
-
-
MainMenu()
-
{
-
llDialog(keyMenuTouch, "Auto Start/Pause/Stop: Automatic Slide Show Controls. Use Set Timer to change slide duration.\n Back/Next: Manutal Slidesow controls.\nTo go from Auto to Manual Pause the presentation.", lstMenu, intDialog);
-
}
-
-
default
-
{
-
state_entry()
-
{
-
//Default Slide Duration 5 Seconds
-
intSlideDur=5;
-
-
//Dialog Communcations change
-
//Can be set to any whole number
-
intDialog=96224;
-
-
//Set Main Menu
-
lstMenu =["Back"," ","Next","Auto Start","Pause","Auto Stop","Reset","Set Timer","Help"];
-
//Set Timer Menu
-
lstMenuTime=["30","45","60","10","15","20","2","3","5"];
-
-
llListen(intDialog, "", llGetOwner(), "");
-
intInvNum = llGetInventoryNumber(INVENTORY_TEXTURE); //Get # of Textures
-
intInvNum=–intInvNum; //Lower # of textures by 1
-
intCurTexture=0; //Set Current Texture to 0
-
llSetTimerEvent(0); //Stop Show
-
llSay(0,"Presentation Viewer Ready");
-
llSetText("~ Offline ~\nTouch to Start", <1,1,1>, 1);
-
}
-
-
touch_start(integer total_number)
-
{
-
keyMenuTouch = llDetectedKey(0);
-
MainMenu();
-
}
-
-
listen(integer channel, string name, key id, string message)
-
{
-
if (message=="Reset")
-
{
-
llSay(0, "Reseting Script");
-
llResetScript();
-
}
-
else if(message=="Help")
-
{
-
llGiveInventory(keyMenuTouch, "_Presentation Viewer Help");
-
}
-
else if(message=="Auto Start")
-
{
-
llSetTimerEvent(intSlideDur); // Set Slide Duration
-
llSay(0,"Auto slide show started");
-
}
-
else if (message=="Pause")
-
{
-
llSetTimerEvent(0); //0 means that the timer is off
-
llSay(0,"Auto slide show paused");
-
MainMenu();
-
}
-
-
else if (message=="Auto Stop")
-
{
-
intCurTexture = 0;
-
llSetTimerEvent(0); //0 means that the timer is off
-
llSetTexture("20e9a242-9df2-fa6b-8b9d-d5b728fdf922",3);
-
llSetText("Fermi Designs Presentation Viewer", <1,1,1>, 1);
-
llSay(0,"Auto slide show stopped");
-
}
-
else if (message=="Back")
-
{
-
if (intCurTexture == 0)
-
{
-
//Do Nothing
-
}
-
else
-
{
-
–intCurTexture;
-
if (intCurTexture < 0);
-
{
-
intCurTexture = 0;
-
}
-
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, intCurTexture),3);
-
llSetText(llGetInventoryName(INVENTORY_TEXTURE, intCurTexture), <1,1,1>, 1);
-
MainMenu();
-
}
-
}
-
else if (message=="Next")
-
{
-
if (intCurTexture == intInvNum)
-
{
-
// Do Nothing
-
MainMenu();
-
}
-
else
-
{
-
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, intCurTexture),3);
-
llSetText(llGetInventoryName(INVENTORY_TEXTURE, intCurTexture), <1,1,1>, 1);
-
++intCurTexture;
-
MainMenu();
-
}
-
}
-
else if (message=="Auto")
-
{
-
llSay(0, "Reseting Script");
-
llResetScript();
-
}
-
else if (message=="Manual")
-
{
-
llSay(0, "Reseting Script");
-
llResetScript();
-
}
-
else if (message=="Set Timer")
-
{
-
llDialog(id, "Please select the amount of time you would like between slides.\n\nAll times are in seconds", lstMenuTime, intDialog);
-
}
-
// Timer Settings
-
else if (message=="2")
-
{
-
intSlideDur=2;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="3")
-
{
-
intSlideDur=3;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="5")
-
{
-
intSlideDur=5;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="10")
-
{
-
intSlideDur=10;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="15")
-
{
-
intSlideDur=15;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="20")
-
{
-
intSlideDur=20;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="30")
-
{
-
intSlideDur=30;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="45")
-
{
-
intSlideDur=45;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
else if (message=="60")
-
{
-
intSlideDur=60;
-
llWhisper(0, "Slide Duration is now " + (string)intSlideDur + " seconds.");
-
}
-
}
-
timer()
-
{
-
-
llSetTexture(llGetInventoryName(INVENTORY_TEXTURE, intCurTexture),3);
-
llSetText(llGetInventoryName(INVENTORY_TEXTURE, intCurTexture), <1,1,1>, 1);
-
++intCurTexture;
-
if (intCurTexture==intInvNum)
-
intCurTexture=0;
-
}
-
-
}
| Print article | This entry was posted by Arthur Fermi on April 9, 2010 at 6:25 pm, and is filed under Arthur Fermi, How To, building. Follow any responses to this post through RSS 2.0. You can leave a response or trackback from your own site. |