Adding a mask and changing some colors inside the ScrollBox.
git-svn-id: svn+ssh://src.earth.threerings.net/nenya/trunk@191 ed5b42cb-e716-0410-a449-f6a68f950b19
This commit is contained in:
@@ -47,6 +47,10 @@ public class ScrollBox extends Canvas
|
|||||||
|
|
||||||
opaqueBackground = 0xFFFFFF;
|
opaqueBackground = 0xFFFFFF;
|
||||||
|
|
||||||
|
_mask = new Sprite();
|
||||||
|
rawChildren.addChild(_mask);
|
||||||
|
this.mask = _mask;
|
||||||
|
|
||||||
_box = new Sprite();
|
_box = new Sprite();
|
||||||
rawChildren.addChild(_box);
|
rawChildren.addChild(_box);
|
||||||
|
|
||||||
@@ -65,8 +69,14 @@ public class ScrollBox extends Canvas
|
|||||||
recheckBounds();
|
recheckBounds();
|
||||||
|
|
||||||
graphics.clear();
|
graphics.clear();
|
||||||
graphics.lineStyle(1, 0);
|
graphics.lineStyle(1, 0x000000, 1.0);
|
||||||
graphics.drawRect(0, 0, width, height);
|
graphics.drawRect(0, 0, width, height);
|
||||||
|
|
||||||
|
var g :Graphics = _mask.graphics;
|
||||||
|
g.clear();
|
||||||
|
g.beginFill(0xffffff, 0.0);
|
||||||
|
g.drawRect(0, 0, width, height);
|
||||||
|
g.endFill();
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function enterFrame (vent :Event) :void
|
protected function enterFrame (vent :Event) :void
|
||||||
@@ -106,8 +116,8 @@ public class ScrollBox extends Canvas
|
|||||||
_bounds = bounds.clone();
|
_bounds = bounds.clone();
|
||||||
_scroller = scroller;
|
_scroller = scroller;
|
||||||
|
|
||||||
_scale = Math.min(1,
|
_scale = Math.min(1, Math.min(_maxWidth / _bounds.width, _maxHeight / _bounds.height));
|
||||||
Math.min(_maxWidth / _bounds.width, _maxHeight / _bounds.height));
|
|
||||||
width = _scale * _bounds.width;
|
width = _scale * _bounds.width;
|
||||||
height = _scale * _bounds.height;
|
height = _scale * _bounds.height;
|
||||||
|
|
||||||
@@ -121,7 +131,8 @@ public class ScrollBox extends Canvas
|
|||||||
{
|
{
|
||||||
var g :Graphics = _box.graphics;
|
var g :Graphics = _box.graphics;
|
||||||
g.clear();
|
g.clear();
|
||||||
g.beginFill(0x0000FF);
|
g.beginFill(0xffffff, 0.3);
|
||||||
|
g.lineStyle(1, 0x000000, 0.3);
|
||||||
g.drawRect(0, 0, ww, hh);
|
g.drawRect(0, 0, ww, hh);
|
||||||
g.endFill();
|
g.endFill();
|
||||||
}
|
}
|
||||||
@@ -159,6 +170,7 @@ public class ScrollBox extends Canvas
|
|||||||
protected var _maxHeight :int;
|
protected var _maxHeight :int;
|
||||||
|
|
||||||
protected var _box :Sprite;
|
protected var _box :Sprite;
|
||||||
|
protected var _mask :Sprite;
|
||||||
|
|
||||||
protected var _scale :Number;
|
protected var _scale :Number;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user