OSSL TextureDrawing: Difference between revisions

From OpenSimulator
Jump to navigationJump to search
imported>MW
No edit summary
imported>MW
No edit summary
Line 19: Line 19:
  public void default_event_state_entry()
  public void default_event_state_entry()
  {
  {
  string drawList = ""
    string drawList = ""
  drawList = osMovePen (drawList, 50,100);  
 
  drawList = osDrawImage(drawList, 100,100,"http://opensimulator.org/images/d/de/Opensim_Wright_Plaza.jpg" );
    drawList = osMovePen (drawList, 50,100);  
  drawList = osSetPenSize (drawList, 1);  
    drawList = osDrawImage(drawList, 100,100,"http://opensimulator.org/images/d/de/Opensim_Wright_Plaza.jpg" );
  drawList = osMovePen (drawList, 50,70);
    drawList = osSetPenSize (drawList, 1);  
  drawList = osDrawEllipse (drawList, 20,20);
    drawList = osMovePen (drawList, 50,70);
  drawList = osMovePen(drawList, 90,70);  
    drawList = osDrawEllipse (drawList, 20,20);
  drawList = osDrawRectangle (drawList, 20,20 );
    drawList = osMovePen(drawList, 90,70);  
  drawList = osMovePen (drawList,130,70);  
    drawList = osDrawRectangle (drawList, 20,20 );
  drawList = osDrawFillRectangle(drawList, 20,20);
    drawList = osMovePen (drawList,130,70);  
  drawList = osSetFontSize (drawList, 12 );
    drawList = osDrawFillRectangle(drawList, 20,20);
  drawList = osMovePen (drawList,15,32);  
    drawList = osSetFontSize (drawList, 12 );
  string regionName = llGetRegionName();
    drawList = osMovePen (drawList,15,32);  
  drawList = osDrawText (drawList, "Hello and welcome to " + regionName );
 
  drawList = osSetFontSize (drawList, 7);  
    string regionName = llGetRegionName();
  drawList = osSetPenColour (drawList, "blue");
    drawList = osDrawText (drawList, "Hello and welcome to " + regionName );
  drawList = osMovePen (drawList, 70,220);
 
  drawList = osDrawText (drawList, "The End");
    drawList = osSetFontSize (drawList, 7);  
  osSetDynamicTextureData("", "vector", drawList, "", 0);
    drawList = osSetPenColour (drawList, "blue");
    drawList = osMovePen (drawList, 70,220);
    drawList = osDrawText (drawList, "The End");
    osSetDynamicTextureData("", "vector", drawList, "", 0);
  }
  }

Revision as of 13:49, 15 March 2008

Function prototypes
string osMovePen(string drawList, int x, int y);
string osDrawLine(string drawList, int startX, int startY, int endX, int endY);
string osDrawLine(string drawList, int endX, int endY);
string osDrawText(string drawList, string text);
string osDrawEllipse(string drawList, int width, int height);
string osDrawRectangle(string drawList, int width, int height);
string osDrawFilledRectangle(string drawList, int width, int height);
string osSetFontSize(string drawList, int fontSize);
string osSetPenSize(string drawList, int penSize);
string osSetPenColour(string drawList, string colour);
string osDrawImage(string drawList, int width, int height, string imageUrl);


Code

//cs
public void default_event_state_entry()
{
   string drawList = ""
   drawList = osMovePen (drawList, 50,100); 
   drawList = osDrawImage(drawList, 100,100,"http://opensimulator.org/images/d/de/Opensim_Wright_Plaza.jpg" );
   drawList = osSetPenSize (drawList, 1); 
   drawList = osMovePen (drawList, 50,70);
   drawList = osDrawEllipse (drawList, 20,20);
   drawList = osMovePen(drawList, 90,70); 
   drawList = osDrawRectangle (drawList, 20,20 );
   drawList = osMovePen (drawList,130,70); 
   drawList = osDrawFillRectangle(drawList, 20,20);
   drawList = osSetFontSize (drawList, 12 );
   drawList = osMovePen (drawList,15,32); 
   string regionName = llGetRegionName();
   drawList = osDrawText (drawList, "Hello and welcome to " + regionName );
   drawList = osSetFontSize (drawList, 7); 
   drawList = osSetPenColour (drawList, "blue");
   drawList = osMovePen (drawList, 70,220);
   drawList = osDrawText (drawList, "The End");
   osSetDynamicTextureData("", "vector", drawList, "", 0);
}