1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76
|
// Name: Sky Image load test script
// License: Public Domain
// Author: Matthew Gates
// Description: This script demonstrates adding and manipulating sky images
//
include("status_label.inc");
useStatusLabel("Sky Images Test 4: ", 50, core.getScreenHeight() - 50, 16, "#ff0000");
status("Load a sky image by centre, size and rotation");
core.clear("starchart");
GridLinesMgr.setFlagEquatorJ2000Grid(true);
GridLinesMgr.setFlagEquatorGrid(false);
core.selectObjectByName("HP118269", false);
StelMovementMgr.setFlagTracking(true);
StelMovementMgr.zoomTo(2,1);
core.wait(2);
status("loading images...");
core.loadSkyImage("image1", "../textures/earthmap.png",
0, 41.33333, // ra, dec centre
60.0, 0, // angSize, rotation
2.5, 14, // minRes, maxBright
false); // visible on load?
core.loadSkyImage("image2", "../textures/earthmap.png",
0, 41.33333, // ra, dec centre
40.0, 90, // angSize, rotation
2.5, 14, // minRes, maxBright
false); // visible on load?
core.loadSkyImage("image3", "../textures/earthmap.png",
0, 41.33333, // ra, dec centre
20.0, 180, // angSize, rotation
2.5, 14, // minRes, maxBright
false); // visible on load?
core.loadSkyImage("image4", "../textures/earthmap.png",
0, 41.33333, // ra, dec centre
10.0, 270, // angSize, rotation
2.5, 14, // minRes, maxBright
false); // visible on load?
core.wait(1.5);
status("showing image (should fade in)");
StelSkyLayerMgr.showLayer("image1", true);
core.wait(0.5);
StelSkyLayerMgr.showLayer("image2", true);
core.wait(0.5);
StelSkyLayerMgr.showLayer("image3", true);
core.wait(0.5);
StelSkyLayerMgr.showLayer("image4", true);
core.wait(4.5);
status("hiding image (should fade out)");
StelSkyLayerMgr.showLayer("image1", false);
core.wait(0.5);
StelSkyLayerMgr.showLayer("image2", false);
core.wait(0.5);
StelSkyLayerMgr.showLayer("image3", false);
core.wait(0.5);
StelSkyLayerMgr.showLayer("image4", false);
core.wait(1.5);
status("removing images, kthxbye");
core.removeSkyImage("image1");
core.removeSkyImage("image2");
core.removeSkyImage("image3");
core.removeSkyImage("image4");
core.wait(1.5);
LabelMgr.deleteAllLabels();
|