控制 Sprite 对象的最终大小

发布于 2025-01-01 17:27:54 字数 427 浏览 2 评论 0原文

我正在使用 flash(没有 MX 或 Spark)渲染 xps 文件,但我遇到了一种无法解决的“矛盾”。 [注意,我尝试仅在核心闪存(例如 Sprite、Shape 等)中工作,我已经使用 Spark 解决了(某种程度上)这个问题。]

xps 文件的页面指定了明确的大小。但是,xps 文件中描述的内容(尤其是路径)有时可能会扩展到该区域之外。

问题是,我希望父 Sprite 具有 xps 文件指定的大小,例如滚动条与页面大小(而不是 sprite 大小)匹配,但在某些情况下 Sprite 比这大得多。

我尝试递归地向下扩展所有内容,然后最后向下扩展父容器。不幸的是,这会导致路径的转换问题,并且我认为它也会导致位图等问题。

在不使用 MX 或 Spark 的情况下,除了独立缩放所有子级之外,我还能做些什么来控制父级 Sprite 的大小吗?

干杯!

I'm rendering a xps file using flash (no MX or Spark), and I'm running into a sort of 'contradiction' that I'm unable to solve. [Note, that I'm trying to work only in core flash (e.g. Sprite, Shape, etc.), I've already solved (sort of) this issue using Spark.]

The pages of the xps file specify an explicit size. However, the content described (especially paths) in the xps file can sometimes extend outside of this area.

The problem is, I want the parent Sprite to have the size specified by the xps file, for example so scroll bars match the page size (not the sprite size), but in some cases the Sprite is much larger than this.

I've tried recursively going down and scaling everything UP, and then at the end scaling the parent container DOWN. Unfortunately, this causes translation problems with paths, and I assume it can also cause problems with bitmaps, etc.

Without using MX or Spark, is there anything I can do to control the size of the parent Sprite, other than scaling all the children independently?

cheers!

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

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

发布评论

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

评论(1

倾听心声的旋律 2025-01-08 17:27:54

我可能会误读您要查找的内容,但您可能会通过使用显示对象容器的scrollRect 属性找到解决方案。如果容器内的对象超出边界,它们将被剪裁。您仍然可以通过更改滚动矩形的 x 和 y 位置来获取它们。 (链接)

I might be misreading what you're looking for, but you might find the solution by using the scrollRect property of your display object containers. If objects inside the container extend beyond the boundaries, they'll be clipped. You can still get to them by changing the x and y positions of the scrollRect. (link)

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