File: sky_image2.ssc

package info (click to toggle)
stellarium 24.3-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 911,396 kB
  • sloc: ansic: 317,377; cpp: 204,602; xml: 48,590; javascript: 26,348; python: 1,254; perl: 1,108; sh: 207; makefile: 190; pascal: 169
file content (63 lines) | stat: -rw-r--r-- 1,919 bytes parent folder | download
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
// 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 2: ", 50, core.getScreenHeight() - 50, 16, "#ff0000");

status("Load multiple images, and turn them on and off...");
core.clear("starchart");
core.selectObjectByName("M31", false);
StelMovementMgr.setFlagTracking(true);
StelMovementMgr.zoomTo(2,1);
core.wait(2);

status("Loading images...");
core.loadSkyImage("image1", "../textures/earthmap.png", 11.5, 41, 11.5, 41.17, 11.75, 41.17, 11.75, 41);
core.wait(1);
core.loadSkyImage("image2", "../textures/earthmap.png", 11.5, 41.2, 11.5, 41.37, 11.75, 41.37, 11.75, 41.2);
core.wait(1);
core.loadSkyImage("image3", "../textures/earthmap.png", 11.5, 41.4, 11.5, 41.57, 11.75, 41.57, 11.75, 41.4);
core.wait(1);

status("playing with the on of buttons...");
for(i=0; i<15; i++)
{
	core.wait(0.1);
	if (i%3==0) { 
		StelSkyLayerMgr.showLayer("image1", true); 
		StelSkyLayerMgr.showLayer("image2", false); 
		StelSkyLayerMgr.showLayer("image3", false); 
	}
	else if ((i+1)%3==0) {
		StelSkyLayerMgr.showLayer("image1", false); 
		StelSkyLayerMgr.showLayer("image2", true); 
		StelSkyLayerMgr.showLayer("image3", false); 
	}
	else if ((i+2)%3==0) {
		StelSkyLayerMgr.showLayer("image1", false); 
		StelSkyLayerMgr.showLayer("image2", false); 
		StelSkyLayerMgr.showLayer("image3", true); 
	}
}

status("turn off the images (fade would be nice)...");
StelSkyLayerMgr.showLayer("image1", true); 
core.wait(0.5);
StelSkyLayerMgr.showLayer("image2", true); 
core.wait(0.5);
StelSkyLayerMgr.showLayer("image3", true); 
core.wait(1);
status("unloading images...");
core.removeSkyImage("image1");
core.wait(0.5);
core.removeSkyImage("image2");
core.wait(0.5);
core.removeSkyImage("image3");
status("kthxbye");
core.wait(1);
LabelMgr.deleteAllLabels();