OsGetRegionMapTexture

From OpenSimulator

(Difference between revisions)
Jump to: navigation, search
(Replace script)
 
(9 intermediate revisions by 5 users not shown)
Line 1: Line 1:
{| width="100%" style="border: thin solid black"
+
{{osslfunc
| colspan="2" align="center" style=background:orange | '''{{SUBPAGENAME}}'''
+
|threat_level=High
|- valign="top"
+
|permissions=${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
|'''Threat Level''' || High
+
|delay=1
 +
|function_syntax=key osGetRegionMapTexture(string regionNameOrID)
 +
|ossl_example=<source lang="lsl">
 +
//
 +
// osGetRegionMapTexture Script Exemple
 +
// Author: djphil
 +
//
  
|- valign="top"
+
default
|'''Function Syntax''' || <source lang="lsl">
+
{
osGetRegionMapTexture(string regionName)
+
     state_entry()
</source>
+
    {
|- valign="top"
+
         llSay(PUBLIC_CHANNEL, "Touch to see osGetRegionMapTexture usage.");
|'''Example(s)||<source lang="lsl">
+
//Example Usage:
+
default {
+
     state_entry() {
+
         key map = osGetRegionMapTexture(llGetRegionName());
+
        llSetTexture(map, 0);
+
 
     }
 
     }
}
+
   
</source>
+
    touch_start(integer number)
 +
    {
 +
        string region = llGetRegionName();
 +
        key texture = osGetRegionMapTexture(region);
  
|}
+
        llSetTexture(TEXTURE_BLANK, ALL_SIDES);
  
This function retrieves the UUID of the texture used to represent the named region on the world map, and returns it.  Using this function, you can place the map texture directly onto a prim.  
+
        if (texture != NULL_KEY)
 +
        {
 +
            llSetTexture(texture, ALL_SIDES);
 +
            llSay(PUBLIC_CHANNEL, "Region map texture applied with success ...");
 +
        }
  
[[Category:OSSL Functions]]
+
        else
 +
        {
 +
            llSay(PUBLIC_CHANNEL, "Region map texture applied without success ...");
 +
        }
 +
    }
 +
}
 +
</source>
 +
|description=This function retrieves the key of the texture used to represent a region on the world map. regionNameOrID can be the region UUID or its name. If empty string, will return the current region map texture key, but in that case you should use osGetMapTexture().
 +
}}

Latest revision as of 18:18, 5 December 2020

key osGetRegionMapTexture(string regionNameOrID)
This function retrieves the key of the texture used to represent a region on the world map. regionNameOrID can be the region UUID or its name. If empty string, will return the current region map texture key, but in that case you should use osGetMapTexture().
Threat Level High
Permissions ${OSSL|osslParcelO}ESTATE_MANAGER,ESTATE_OWNER
Extra Delay 1 seconds
Example(s)
//
// osGetRegionMapTexture Script Exemple
// Author: djphil
//
 
default
{
    state_entry()
    {
        llSay(PUBLIC_CHANNEL, "Touch to see osGetRegionMapTexture usage.");
    }
 
    touch_start(integer number)
    {
        string region = llGetRegionName();
        key texture = osGetRegionMapTexture(region);
 
        llSetTexture(TEXTURE_BLANK, ALL_SIDES);
 
        if (texture != NULL_KEY)
        {
            llSetTexture(texture, ALL_SIDES);
            llSay(PUBLIC_CHANNEL, "Region map texture applied with success ...");
        }
 
        else
        {
            llSay(PUBLIC_CHANNEL, "Region map texture applied without success ...");
        }
    }
}
Personal tools
General
About This Wiki