如何计算Sprite的尺寸?尺寸、Sprite

由网友(我的心里没有伱)分享简介:我有一个精灵,我做一些自定义绘制的,但我想容器知道正确定位精灵。要做到这一点,容器需要知道有多大的精灵是。的UIComponents经过一个阶段的措施,但精灵没有。如何计算的大小,一个精灵会是谁?I have a sprite that I do some custom drawing in, but I would...

我有一个精灵,我做一些自定义绘制的,但我想容器知道正确定位精灵。要做到这一点,容器需要知道有多大的精灵是。的UIComponents经过一个阶段的措施,但精灵没有。如何计算的大小,一个精灵会是谁?

I have a sprite that I do some custom drawing in, but I would like the container to know where to position the sprite properly. To do this, the container needs to know how big the sprite is. UIComponents go through a measure stage, but sprites don't . How do I calculate the size that a sprite will be?

编辑:我做的Event.ENTER_FRAME绘图,它的动画,这样的时候,我不能提前告诉有多大这将是。 UIComponent具有测量功能,我想创建类似的东西。

I'm doing the drawing in Event.ENTER_FRAME, and it's animated, so I can't tell ahead of time how big it's going to be. The UIComponent has a measure function and I'd like to create something similar.

推荐答案

在precise的回答,据我所知,你不能告诉提前,你必须实际绘制成的精灵,以确定它的大小。

The precise answer, as far as I can gather is, you can't tell ahead of time, you must actually draw into the sprite to determine it's size.

阅读全文

相关推荐

最新文章