// 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 1: ", 50, core.getScreenHeight() - 50, 16, "#ff0000");

status("First lets look at the place we will load our image...");
core.clear("starchart");
core.selectObjectByName("M31", false);
StelMovementMgr.setFlagTracking(true);
StelMovementMgr.zoomTo(2,1);
core.wait(2);

status("loading image...");
core.loadSkyImage("image", "../textures/earthmap.png", 
                  41, 11.5,     // ra, dec first corner
                  41.17, 11.5,  // ra, dec second corner
                  41.17, 11.75, // ra, dec third corner
                  41, 11.75,    // ra, dec fourth corner
                  2.5, 14,      // minRes, maxBright
                  false);       // visible on load?

core.wait(1.5);

status("showing image (should fade in)");
StelSkyImageMgr.showImage("image", true); 
core.wait(1.5);

status("hiding image (should fade out)");
StelSkyImageMgr.showImage("image", false); 
core.wait(1.5);

status("showing image (should fade in)");
StelSkyImageMgr.showImage("image", true); 
core.wait(1.5);

status("hiding image (should fade out)");
StelSkyImageMgr.showImage("image", false); 
core.wait(1.5);

status("removing image, kthxbye");
core.removeSkyImage("image");
core.wait(1.5);
LabelMgr.deleteAllLabels();

