labels.ssc   labels.ssc 
skipping to change at line 30 skipping to change at line 30
// in the label manager (e.g. turning the label on and off) // in the label manager (e.g. turning the label on and off)
// This function prints a line of text at a fixed place on the screen // This function prints a line of text at a fixed place on the screen
// pauses for a few seconds and then hides the text. I will use this // pauses for a few seconds and then hides the text. I will use this
// for providing information to the user. // for providing information to the user.
// //
// The label is created in an "off" state, and then faded in and out. // The label is created in an "off" state, and then faded in and out.
// The label is deleted after it has been displayed. // The label is deleted after it has been displayed.
function commentary(text) function commentary(text)
{ {
var id = LabelMgr.labelScreen(text, 100, 100, false, 20, "#aaaaaa"); commentary_at(text, 30, 30);
}
function commentary_at(text, x, y)
{
var id = LabelMgr.labelScreen(text, x, y, false, 20, "#aaaaaa");
LabelMgr.setLabelShow(id, true); LabelMgr.setLabelShow(id, true);
core.wait(2); core.wait(2);
LabelMgr.setLabelShow(id, false); LabelMgr.setLabelShow(id, false);
core.wait(1); core.wait(1);
LabelMgr.deleteLabel(id); LabelMgr.deleteLabel(id);
} }
commentary("This script is a test of LabelMgr"); commentary("This script is a test of LabelMgr");
commentary("Labels can be fixed to screen x,y values (like this label)...") commentary("Labels can be fixed to screen x,y values...");
; commentary_at("0,0", 0, 0);
commentary_at("100,100", 100, 100);
commentary_at("0,400", 0, 400);
commentary_at("600,20", 600, 20);
commentary("Or they can be attached to a named object..."); commentary("Or they can be attached to a named object...");
var myOb = "HP 21421"; // Aldebaran var myOb = "HP 21421"; // Aldebaran
var id = LabelMgr.labelObject("A bright star!" , myOb, false, 16, "#aaaaaa" , "S", 10); var id = LabelMgr.labelObject("A bright star!" , myOb, false, 16, "#aaaaaa" , "S", 10);
LabelMgr.setLabelShow(id, true); LabelMgr.setLabelShow(id, true);
core.wait(1); core.wait(1);
commentary("The label above is connected to " + myOb); commentary("The label above is connected to " + myOb);
core.setTimeRate(150); core.setTimeRate(150);
commentary("Watch as the time advances"); commentary("Watch as the time advances");
 End of changes. 2 change blocks. 
3 lines changed or deleted 11 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/