flash` stage.quality`影响`displayObject.transform.concatenatedMatrix`缩放

发布于 2025-02-10 16:50:43 字数 1669 浏览 0 评论 0原文

通过设置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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

浪菊怪哟 2025-02-17 16:50:43

“这种行为的原因是什么?”

内容,没有闪存IDE(或AS3编译器),但是...

我无法在此处确认任何 /代码>数字似乎受到抗偏(或平滑)算法分配了多少像素网格区域的影响。比例尺与网格大小 n分开(忽略其他x n part)。

如果您想解决有关显示对象中不需要的偏移的问题,则也许您可以使用公式来说明更改,以不同的阶段质量(他们的nxn size)...

例如:


strong>低质量是您的起点没有反相反,因此值为20,然后您稍后可以看到8x8阶段< /代码>变为20/8 = 2.5 < /code> ...

Type                pixel-grid      Matrix values
---------------------------------------------------------------------------

low stage           0 x 0           (a=20,      b=0, c=0, d=20,     tx=0, ty=0)

medium stage        2 x 2           (a=10,      b=0, c=0, d=10,     tx=0, ty=0)

high stage          4 x 4           (a=5,       b=0, c=0, d=5,      tx=0, ty=0)

best stage          4 x 4           (a=5,       b=0, c=0, d=5,      tx=0, ty=0)

8x8 stage           8 x 8           (a=2.5,     b=0, c=0, d=2.5,    tx=0, ty=0)

16x16linear stage   16 x 16         (a=1.25,    b=0, c=0, d=1.25,   tx=0, ty=0)

"What's the reason for this behavior?"

I cannot confirm anything, no Flash IDE (or AS3 compiler) here, but...

The scaleX and scaleY 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 size N (ignore the other x 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 the 8x8 stage becomes 20 / 8 = 2.5 ...

Type                pixel-grid      Matrix values
---------------------------------------------------------------------------

low stage           0 x 0           (a=20,      b=0, c=0, d=20,     tx=0, ty=0)

medium stage        2 x 2           (a=10,      b=0, c=0, d=10,     tx=0, ty=0)

high stage          4 x 4           (a=5,       b=0, c=0, d=5,      tx=0, ty=0)

best stage          4 x 4           (a=5,       b=0, c=0, d=5,      tx=0, ty=0)

8x8 stage           8 x 8           (a=2.5,     b=0, c=0, d=2.5,    tx=0, ty=0)

16x16linear stage   16 x 16         (a=1.25,    b=0, c=0, d=1.25,   tx=0, ty=0)
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文