Search notes:

Stellarium API: ScreenImageMgr.createScreenImage

The following example uses a png rather than LabelMgr.labelScreen() to display a text on a scene.
// vi: ft=javaScript
//
// cp helloWorld.png $env:APPDATA\Stellarium\scripts
//
// ..\..\runScript.bat createScreenImage.ssc

try {

//
// Go to Irchelturm
//
   core.setObserverLocation(
       8 + 36/60 + 25.85/60/60, // core.dmsToRad( 8, 36, 25.85 ), // longitude
      47 + 32/60 + 21.48/60/60, // core.dmsToRad(47, 32, 21.48 ), // latitude
       0,                       // Altitude
       0,                       // Time to travel
      "",                       // or "Irchelturm",
      "Earth"                   // This parameter seems necessary
   );

   core.setDate(
     '2020-09-03T22:00:00',
     'local'              , // or 'utc'
      true                  // enable Delta T correction
   );

//
// Show image
//
   ScreenImageMgr.createScreenImage(
     'img_id'        ,  // An arbitrary (string) ID to identify the image
     'helloWorld.png',  // File name, expected to be under the script/ directory
      20 , 10        ,  // x, y
      1.0            ,  // scale factor
      true           ,  // initial visibility
      1.0            ,  // alpha
      0.01              // fade duration
   );

}
catch (e) {
  LabelMgr.deleteAllLabels();
  LabelMgr.labelScreen(e.toString(), 20, 20, true, 20, '#ff0000');
}
Github repository about-Stellarium, path: /API/ScreenImageMgr/createScreenImage.ssc

See also

Stellarium Script API

Index