ActionScript 3 AS3 DrawPixelBorderAroundStage静态类

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了ActionScript 3 AS3 DrawPixelBorderAroundStage静态类相关的知识,希望对你有一定的参考价值。

package com.adrianparr.utils 
{
	import flash.display.Stage;
	import flash.display.Shape;

	public class DrawPixelBorderAroundStage
	{
		
		public static function draw($stage:Stage, $colour:uint, $width:uint, $alpha:Number):Shape
		{
			var border:Shape = new Shape();
			border.graphics.beginFill($colour, $alpha);
			border.graphics.drawRect($width, 0, $stage.stageWidth-$width, $width);
			border.graphics.drawRect($stage.stageWidth-$width, $width, $width, $stage.stageHeight-$width);
			border.graphics.drawRect(0, $stage.stageHeight-$width, $stage.stageWidth-$width, $width);
			border.graphics.drawRect(0, 0, $width, $stage.stageHeight-$width);
			border.graphics.endFill();
			return border;
		}
		
	}

}

// Usage example
//
// import com.adrianparr.utils.DrawPixelBorderAroundStage;
// private var _border:Shape;
// _border = DrawPixelBorderAroundStage.draw(stage, 0x036CB4, 1, 1);
// addChild(_border);

以上是关于ActionScript 3 AS3 DrawPixelBorderAroundStage静态类的主要内容,如果未能解决你的问题,请参考以下文章

[ActionScript 3.0] AS3.0 水面波纹效果

ActionScript 3 AS3:使用SWFObject2和AS3传递变量

ActionScript 3 克隆数组(AS3)

ActionScript 3 AS3序列化

ActionScript 3 As3初始上限

ActionScript 3 AS3 HTML清理