salahzar

script per visualizzare notecard

Feb 17th, 2014
233
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Example of osDrawText
  2. string name;
  3. integer line;
  4.  
  5. string content;
  6.  
  7. default
  8. {
  9.     state_entry()
  10.     {
  11.         line=0; name=llGetInventoryName(INVENTORY_NOTECARD,0);
  12.         content="";
  13.         llGetNotecardLine(name,line);
  14.     }
  15.     dataserver(key id, string str)
  16.     {
  17.         if(str==EOF) state ready;
  18.         content+=str+"\n";
  19.         //llSay(0,str);
  20.         line++;
  21.         llGetNotecardLine(name,line);
  22.        
  23.     }
  24. }
  25. state ready
  26. {
  27.     state_entry()
  28.     {
  29.         //llSay(0,"content "+content);
  30.         string CommandList = ""; // Storage for our drawing commands
  31.  
  32.  
  33.         CommandList = osMovePen( CommandList, 10, 10 );           // Upper left corner at <10,10>
  34.         CommandList = osSetFontName ( CommandList, "Times");
  35.         CommandList = osSetPenColor( CommandList,"Black");
  36.         CommandList = osSetFontSize( CommandList,72);
  37.         CommandList = osSetPenColor( CommandList,"Black");
  38.         CommandList = osDrawText( CommandList,name+"\n");
  39.         CommandList = osMovePen( CommandList, 10, 120 );           // Upper left corner at <10,10>
  40.        
  41.         CommandList = osSetFontSize( CommandList, 36 );
  42.         CommandList = osDrawText( CommandList, content ); // Place some text
  43.  
  44.         // Now draw the image
  45.         osSetDynamicTextureData( "", "vector", CommandList, "width:1024,height:1024", 0 );
  46.     }
  47.     touch_start(integer count)
  48.     {
  49.         llResetScript();
  50.     }
  51.    
  52.  
  53. }
Add Comment
Please, Sign In to add comment