开发者

underline cont

开发者 https://www.devze.com 2022-12-16 21:46 出处:网络
This is a continuation of the question below. Basically I discovered its no problem at all to draw lines or shapes or whatever directly onto an mx:Text object using its graphics property(Text.graphic

This is a continuation of the question below.

Basically I discovered its no problem at all to draw lines or shapes or whatever directly onto an mx:Text object using its graphics property (Text.graphics.lineTo, etc.). If just displaying that text, then any such drawn lines are displayed as well. However, if that Text object is used as a mask, then any drawn lines on that text obje开发者_运维知识库ct are merely ignored when the mask is rendered.

And its hard for me to see the reason behind this, if anyone else is able to. I mean you're designating the Text object itself as the mask. It seems like any visual change to that text object should be part of the mask.


The graphics.lineTo method doesn't appear to create a mask regardless of where it is called.

However, calling

 txt1.graphics.beginFill(0);
 txt1.graphics.drawRect(...)  //(where the Rectangle is thin enough to be a line)
 txt1.graphics.endFill();

does in fact work as a mask, (adding the shape to the actual text which then collectively form a mask). (But the coordinates of the rectangle are scaled by whatever txt1.scaleX,scaleY is currently so that has to be considered as well.)

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号