/////////////////////////////////////////////////////////////////////////// // Copyright (C) Wizardry and Steamworks 2011 - License: GNU GPLv3 // // Please see: http://www.gnu.org/licenses/gpl.html for legal details, // // rights of fair usage, the disclaimer and warranty conditions. // /////////////////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////// // CONFIGURATION // ////////////////////////////////////////////////////////// // Change this to the time between // fade-in and fade-out events. float TIME_BETWEEN_FADES = 7; // Change this to the time it takes // to fade-out the screen. float FADE_OUT_TIME = .2; // Change this to the time it takes // to fade-in the screen. float FADE_IN_TIME = .2; /////////////////////////////////////////////////////////////////////////// // INTERNALS // /////////////////////////////////////////////////////////////////////////// integer o = -1; float f; default { state_entry() { llSetTimerEvent(TIME_BETWEEN_FADES); } timer() { llSetTimerEvent(0); if(o = ~o) { llSensorRepeat("", NULL_KEY, ACTIVE, .1, f=.0, FADE_IN_TIME); return; } llSensorRepeat("", NULL_KEY, ACTIVE, .1, f=1.0, FADE_OUT_TIME); } no_sensor() { if(f<.0 || f>1.0) { llSensorRemove(); llSetTimerEvent(TIME_BETWEEN_FADES); return; } if(!o) { llSetLinkAlpha(2, f-=.1, ALL_SIDES); return; } llSetLinkAlpha(2, f+=.1, ALL_SIDES); } }