我想制作自己的可视化组件,我应该扩展哪个? UIComponent 还是 Sprite?

发布于 2024-10-06 06:13:47 字数 218 浏览 1 评论 0原文

我想制作自己的可视化组件。但我不知道该为我的课程扩展什么。看来UIComponent有commitDisplay方法,该方法会被invalidateDisplayList调用,而Sprite没有这个方法。这是否意味着我可以将 UIComponent 扩展为根组件并将 Sprite 扩展为子组件。那么我可以在UIComponent的commitDisplay函数中调用儿童绘画函数(我自己写的)吗?

谢谢!

I want to make my own visualization component. But I don't know what to extend for my class. It seems that UIComponent has commitDisplay method which would be called by invalidateDisplayList, and Sprite does not have this method. Does it mean that I could extend UIComponent as the root Component and extend Sprite as children. So I could call children's painting functions (written by myself) in the UIComponent's commitDisplay function?

Thanks!

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

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

发布评论

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

评论(1

尛丟丟 2024-10-13 06:13:47

您可以做任何事情,从创建独立于 Flex 组件架构的自己的类/包到扩展 UIComponent(或实现 IUIComponent)。

如果这只是一个 ActionScript 项目,您的代码将需要使用 Sprite 的图形对象和绘图 api,或者向 Sprite 添加子项以使其显示在屏幕上。

如果这是针对 Flex 应用程序,则您想要呈现的任何内容都需要集成到 UIComponent 中,并在组件的 updateDisplaylist 方法中绘制。如果您只想将子项添加到 UIComponent,请在 createChildren 方法中执行此操作。

You could do anything from creating your own class/package independent of the flex component architecture to extending UIComponent (or implementing IUIComponent).

If this is just an ActionScript project, your code would need to use a Sprite's graphics object and drawing api, or add children to the sprite for it to appear on screen.

If this is for a Flex application, whatever you want to render would need to be integrated in a UIComponent, and drawn in the component's updateDisplaylist method. If you just want to add children to a UIComponent, do that in the createChildren method.

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