Put Google drawing on a prim

Use this script to put a Google graphic on any prim. Clicking on the drawing in-world will automatically refresh it.

You can use it to create a white board for an in-world presentation. You can allow several people to edit at once by sharing the Google Doc with them.

Of course, if you’re using a second or third-generation viewer, you can simply edit the document in-world, in real time, without using this script at all. ┬áThis script is for those using SLv1-compatible viewers.

You can also use this to create signboards for your grid that you need to update on a regular basis. Just change the appropriate Google drawing, click on your sign boards, and you’re done — no need to upload new drawings and edit the textures on each surface.

Create your drawing

First, you will need to go to Google Docs and go to Create New – Drawing (in the drop-down menu on top left of screen).

Now, draw something. If you leave the background as is, it will come out transparent.

When you’ve got your drawing, click on Share – Publish to the Web (in the drop-down menu on top right of screen).

You will get a URL that looks something like:

https://docs.google.com/drawings/pub?id=1xLB4NvrfXrlWttsTAUoQdX65lj5PmA0mDuAay4Ibgdc&w=960&h=720

Save that URL and paste it into the top of this script, where I’ve got the text highlighted in blue, and drop the script on any prim (flat panels work best):

//Change the address inside the quotation marks on this next line to your Google drawing:
string website = "https://docs.google.com/drawings/pub?id=1xLB4NvrfXrlWttsTAUoQdX65lj5PmA0mDuAay4Ibgdc&w=960&h=720";

float firstClick= 0;

default {

          state_entry() {

          string URLTexture = osSetDynamicTextureURL("", "image", website, "", 600);
            if (llStringLength(URLTexture)>0) {
                llSetTexture(URLTexture, ALL_SIDES);
                 }
               }

         touch_start(integer total_number)
             {
                key gAvatarKey = llDetectedKey(0);
                string URLTexture = osSetDynamicTextureURL("", "image", website, "", 600);
                     if (llStringLength(URLTexture)>0) {
                                  llSetTexture(URLTexture, ALL_SIDES);
                                                   }
           float t= llGetTime();
        if( (firstClick != 0) && (t < (firstClick + 1)) ){
            firstClick=0;
            // Double Click Event
            llLoadURL(gAvatarKey, "View the original website.", website);

        } else {
            firstClick= t;
        }
    }

     }