空气2.6无铬窗口与阴影

时间:2011-11-22 13:39:18

标签: actionscript-3 air

我一直在环顾四周,没有找到任何问题的答案: 你如何获得一个带有空气2.6的阴影的无铬窗口?

这是我的-app.xml设置:

<initialWindow>
<content>maker.swf</content>
<systemChrome>none</systemChrome>
<transparent>true</transparent>
<visible>true</visible>
<fullScreen>false</fullScreen>
<aspectRatio>portrait</aspectRatio>
<renderMode>auto</renderMode>
<maximizable>false</maximizable>
<minimizable>false</minimizable>
<resizable>true</resizable>

然后在我的AIR项目中,我将一个简单的精灵设置为背景。我可以在它上面应用一个内部阴影,但是如果我尝试使用正常的阴影,我就是看不到阴影。我猜这是因为与我的窗口大小相比,阴影超出范围?

以下是背景的制作方法:

_bg = new Sprite();
_bg.graphics.beginFill(0xd6d6d6, 1);
_bg.graphics.drawRect(0, 0, stage.stageWidth, stage.stageHeight);
_bg.graphics.endFill();         
this.addChild(_bg);
_bg.filters = [new DropShadowFilter(0, 45, 0, 0.8, 5, 5, 1, 1, false, false, false)];

1 个答案:

答案 0 :(得分:2)

使窗口变大,使背景小于窗口大小,并将阴影添加到背景精灵中(就像你已经做过的那样)。 如果您希望阴影也在窗口的左侧和顶侧伸出,请确保背景精灵也从左上角开始偏移。