当前位置: > > > Flex - 通过滤镜给文字描边

Flex - 通过滤镜给文字描边

为了让文字更加醒目,我们有时需要给文字描边,这个只需要使用发光滤镜GlowFilter即可。
使用:new GlowFilter(0X000000,1,2,2,255)。可以给文字描上黑边,这样即使有背景图片,文字也很突出。
代码如下:
<s:Label color="#00ff00" text="{_t}" filters="{[new GlowFilter(0X000000,1,2,2,255)]}"/>
<s:Label color="#00ff00" text="{_t}"/>
<s:Label color="#ffffff" text="{_t}" filters="{[new GlowFilter(0X000000,1,2,2,255)]}"/>
<s:Label color="#ffffff" text="{_t}"/>
效果图如下:

评论0