flash` stage.quality`影响`displayObject.transform.concatenatedMatrix`缩放
通过设置stage.Quality
来调整闪光阶段质量,似乎会影响矩阵displayObject.transform.concatenatedMatrix
:
import flash.text.TextField;
var child = new TextField();
var quals = ["best", "high", "16x16", "16x16linear", "8x8", "8x8linear", "low", "medium"];
for (var i in quals) {
var qual = quals[i];
stage.quality = qual;
trace(qual + " TextField " + child.transform.concatenatedMatrix);
trace(qual + " stage " + stage.transform.concatenatedMatrix);
}
上面代码可产生以下输出(带有最新版本的Adobe Animate ,在Flash Projector 35中运行):
best TextField (a=5, b=0, c=0, d=5, tx=0, ty=0)
best stage (a=5, b=0, c=0, d=5, tx=0, ty=0)
high TextField (a=5, b=0, c=0, d=5, tx=0, ty=0)
high stage (a=5, b=0, c=0, d=5, tx=0, ty=0)
16x16 TextField (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
16x16 stage (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
16x16linear TextField (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
16x16linear stage (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
8x8 TextField (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
8x8 stage (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
8x8linear TextField (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
8x8linear stage (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
low TextField (a=20, b=0, c=0, d=20, tx=0, ty=0)
low stage (a=20, b=0, c=0, d=20, tx=0, ty=0)
medium TextField (a=10, b=0, c=0, d=10, tx=0, ty=0)
medium stage (a=10, b=0, c=0, d=10, tx=0, ty=0)
我找不到有关此行为的任何文档 - 我阅读的有关阶段质量和显示对象转换的所有内容都表明它们应该是完全独立的。
一些观察结果:
stage.transform.matrix
不受影响,表明“在”阶段转换之前“应用”缩放转换(好像阶段有父母)。- 不同的
contenatedMatrix
值都执行缩放操作,质量较低的质量似乎会导致较高缩放
这种行为的原因是什么?
Adjusting the Flash stage quality by setting stage.quality
appears to affect the matrix DisplayObject.transform.concatenatedMatrix
:
import flash.text.TextField;
var child = new TextField();
var quals = ["best", "high", "16x16", "16x16linear", "8x8", "8x8linear", "low", "medium"];
for (var i in quals) {
var qual = quals[i];
stage.quality = qual;
trace(qual + " TextField " + child.transform.concatenatedMatrix);
trace(qual + " stage " + stage.transform.concatenatedMatrix);
}
The above code produces the following output (with the latest version of Adobe Animate, running in Flash Projector 35):
best TextField (a=5, b=0, c=0, d=5, tx=0, ty=0)
best stage (a=5, b=0, c=0, d=5, tx=0, ty=0)
high TextField (a=5, b=0, c=0, d=5, tx=0, ty=0)
high stage (a=5, b=0, c=0, d=5, tx=0, ty=0)
16x16 TextField (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
16x16 stage (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
16x16linear TextField (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
16x16linear stage (a=1.25, b=0, c=0, d=1.25, tx=0, ty=0)
8x8 TextField (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
8x8 stage (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
8x8linear TextField (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
8x8linear stage (a=2.5, b=0, c=0, d=2.5, tx=0, ty=0)
low TextField (a=20, b=0, c=0, d=20, tx=0, ty=0)
low stage (a=20, b=0, c=0, d=20, tx=0, ty=0)
medium TextField (a=10, b=0, c=0, d=10, tx=0, ty=0)
medium stage (a=10, b=0, c=0, d=10, tx=0, ty=0)
I haven't been able to find any documentation about this behavior - everything that I've read about the stage quality and display object transformations suggests they should be completely independent.
Some observations:
Stage.transform.matrix
is unaffected, suggesting that this scaling transformation is applied 'before' the stage transformation (as if the stage had a parent).- The different
concatenatedMatrix
values all perform a scaling operation, with lower qualities appearing to result in higher scaling
What's the reason for this behavior?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
内容,没有闪存IDE(或AS3编译器),但是...
我无法在此处确认任何 /代码>数字似乎受到抗偏(或平滑)算法分配了多少像素网格区域的影响。比例尺与网格大小
n
分开(忽略其他x n
part)。如果您想解决有关显示对象中不需要的偏移的问题,则也许您可以使用公式来说明更改,以不同的阶段质量(他们的nxn size)...
例如:
:
strong>低质量是您的起点没有反相反,因此值为
20
,然后您稍后可以看到8x8阶段< /代码>变为
20/8 = 2.5 < /code> ...
I cannot confirm anything, no Flash IDE (or AS3 compiler) here, but...
The
scaleX
andscaleY
numbers seem to be affected by how much pixel-grid area is assigned by the Anti-Aliasing (or smoothing) algorithm. The scale numbers are divided with grid sizeN
(ignore the otherx N
part).If you're trying to solve a problem about unwanted offsets in your display objects then maybe you can use the formula to account for changes at different Stage Qualities (their NxN size)...
For example:
At Low Quality is your starting point of no anti-aliasing, so the value is
20
then you can see later how the8x8 stage
becomes20 / 8 = 2.5
...