Remember dimming/sharpening preferences
[potlatch2.git] / net / systemeD / halcyon / TileSet.as
index fe631d2af5b28f7e0498b47e6d8c96eb0831b825..9890926e6c2505f322e9dbb23f5118e1d288d1ea 100644 (file)
@@ -36,12 +36,13 @@ package net.systemeD.halcyon {
 
         public function TileSet(map:Map) {
                        this.map=map;
 
         public function TileSet(map:Map) {
                        this.map=map;
-                       alpha=0.5;
                        createSprites();
                        map.addEventListener(MapEvent.NUDGE_BACKGROUND, nudgeHandler);
                }
        
                        createSprites();
                        map.addEventListener(MapEvent.NUDGE_BACKGROUND, nudgeHandler);
                }
        
-               public function init(params:Object, update:Boolean=false):void {
+               public function init(params:Object, update:Boolean=false, dim:Boolean=true, sharpen:Boolean=false):void {
+                       setDimming(dim);
+                       sharpening=sharpen;
                        baseurl=params.url;
                        scheme =params.scheme ? params.scheme : '900913';
                        tiles={};
                        baseurl=params.url;
                        scheme =params.scheme ? params.scheme : '900913';
                        tiles={};
@@ -60,6 +61,9 @@ package net.systemeD.halcyon {
                public function setDimming(dim:Boolean):void {
                        alpha=dim ? 0.5 : 1;
                }
                public function setDimming(dim:Boolean):void {
                        alpha=dim ? 0.5 : 1;
                }
+               public function getDimming():Boolean {
+                       return (alpha<1);
+               }
 
                public function setSharpen(sharpen:Boolean):void {
                        var f:Array=[]; if (sharpen) { f=[sharpenFilter]; }
 
                public function setSharpen(sharpen:Boolean):void {
                        var f:Array=[]; if (sharpen) { f=[sharpenFilter]; }
@@ -71,6 +75,9 @@ package net.systemeD.halcyon {
                        }
                        sharpening=sharpen;
                }
                        }
                        sharpening=sharpen;
                }
+               public function getSharpen():Boolean {
+                       return sharpening;
+               }
 
                public function changeScale(scale:uint):void {
                        for (var i:uint=map.MINSCALE; i<=map.MAXSCALE; i++) {
 
                public function changeScale(scale:uint):void {
                        for (var i:uint=map.MINSCALE; i<=map.MAXSCALE; i++) {