Warning: Parameter 1 to Language::getMagic() expected to be a reference, value given in /sda/2/c/digigrids/wiki/includes/StubObject.php on line 58

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675

Warning: preg_match_all(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 670

Warning: Invalid argument supplied for foreach() in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 671

Warning: preg_replace(): Compilation failed: group name must start with a non-digit at offset 4 in /sda/2/c/digigrids/wiki/includes/MagicWord.php on line 675
OsSetDynamicTextureDataBlendFace - DigiWiki

OsSetDynamicTextureDataBlendFace

De DigiWiki.

 
Ligne 1 : Ligne 1 :
<lsl>
<lsl>
-
// Example of osSetDynamicTextureDataBlendFace used to put a number on each face of a prim
+
// Example / Sample Script to show function use.
-
 
+
//
-
string FontName = "Arial";
+
// Script Title:    osSetDynamicTextureDataBlendFace.lsl
-
integer FontSize = 128;
+
// Script Author:
-
+
// Threat Level:    VeryLow
-
NumberEachFace() {
+
// Script Source:  SUPPLEMENTAL http://opensimulator.org/wiki/osSetDynamicTextureDataBlendFace
-
    integer face = llGetNumberOfSides();
+
//                  Above Supplemental gives a good Example numbers all iFaces of any given prim.
-
    while (face--) {
+
//
-
        string text = (string)face;
+
// Notes: See Script Source reference for more detailed information
-
        vector size = osGetDrawStringSize("vector", text, FontName, FontSize);
+
// This sample is full opensource and available to use as you see fit and desire.
-
        integer xpos = (256 - (integer)size.x) >> 1;
+
// Threat Levels only apply to OSSL & AA Functions
-
        integer ypos = (256 - (integer)size.y) >> 1;
+
// See http://opensimulator.org/wiki/Threat_level
-
+
// ================================================================
-
        string commandList = "";
+
// C# Source Line:      public string osSetDynamicTextureDataBlendFace(string sDynamicID, string sContentType, string sData, string sExtraParams, bool iBlend, int iDisp, int timer, int alpha, int iFace)
-
        commandList = osMovePen(commandList, xpos, ypos);
+
// Inworld Script Line: osSetDynamicTextureDataBlendFace(string sDynamicID, string sContentType, string sData, string sExtraParams, integer iBlend, integer iDisp, integer timer, integer alpha, integer iFace;
-
        commandList = osSetFontName(commandList, FontName);
+
//
-
        commandList = osSetFontSize(commandList, FontSize);
+
// Example of osSetDynamicTextureDataBlendFace
-
        commandList = osDrawText(commandList, text);
+
//
-
+
// ExtraParams Values:
-
         osSetDynamicTextureDataBlendFace("", "vector", commandList, "width:256,height:256",
+
//    width - width of the dynamic texture in pixels (example: width:256)  
-
                                        FALSE, 2, 0, 255, face);
+
//    height - height of the dynamic texture in pixels (example: height:256)
 +
//    alpha - alpha (transparency) component of the dynamic texture. Values are from 0-clear to 255-solid, and false to turn off the alpha layer completely (example: alpha:255)  
 +
//    bgcolour - specifies the background color of the texture (example: bgcolour:Red)  
 +
//    setalpha
 +
//    integer value - any integer value is treated like specifing alpha component
 +
//
 +
default
 +
{
 +
    state_entry()
 +
    {
 +
         llSay(0,"Touch to see osSetDynamicTextureDataBlend used to render custom drawings on a prim");
     }
     }
-
}
+
    touch_start(integer total_num)
-
   
+
    {
-
default {
+
        string sDynamicID = "";                          // not implemented yet
-
    state_entry() {
+
        string sContentType = "vector";                  // vector = text/lines,etc. image = texture only
-
         NumberEachFace();
+
        string sData = "";                              // Storage for our drawing commands
-
    }
+
        string sExtraParams = "width:512,height:512";    // optional parameters in the following format: [param]:[value],[param]:[value]
-
    changed(integer change) {
+
        integer iBlend = TRUE;                          // TRUE = the newly generated texture is iBlended with the appropriate existing ones on the prim
-
         if (change & CHANGED_SHAPE)
+
        integer iDisp = 2;                              // 1 = expire deletes the old texture.  2 = temp means that it is not saved to the sDatabase.
-
            NumberEachFace();
+
        integer iTimer = 0;                              // timer is not implemented yet, leave @ 0
 +
        integer iAlpha = 255;                            // 0 = 100% Alpha, 255 = 100% Solid
 +
        integer iFace = ALL_SIDES;                      // Faces of the prim, Select the Face you want
 +
        //
 +
        // sData (drawing commands) used in the example.
 +
         sData = osMovePen(sData, 20, 40);               // place pen @ X,Y coordinates
 +
        sData = osSetFontName(sData, "Arial");          // Set the Fontname to use
 +
        sData = osSetFontSize(sData, 10);                // Set the Font Size in pixels
 +
         sData = osSetPenColor( sData, "Green" );        // Set the pen color to Green
 +
        sData = osDrawText(sData, "Written Text to display on\nALL_SIDES ");  // The text to write
 +
        // Now draw it out
 +
        osSetDynamicTextureDataBlendFace( sDynamicID, sContentType, sData, sExtraParams, iBlend, iDisp, iTimer, iAlpha, iFace );
     }
     }
}
}
</lsl>
</lsl>

Version actuelle en date du 23 novembre 2012 à 14:51

Outils personnels
donate
Google Ads