papervision 中有简单的按钮

发布于 2024-11-26 07:00:07 字数 140 浏览 1 评论 0原文

papervision 中有一件简单的事情我做不到,我想在我的 swf 上有一个简单的按钮,就像我们在 flash 中一样,只是屏幕上的一个 2d 正方形,您可以单击它并执行一些操作,我没有'找不到任何解决方案
如果有人可以帮助我,我将不胜感激
谢谢

there's a simple thing in papervision I can't do , I want to have a simple button on my swf like we have in flash , just a 2d square which is on screen and you can click on it and have some action , I didn't find any solutions for this

I'll be appreciated if someone can help me with this

thanks

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

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

发布评论

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

评论(1

起风了 2024-12-03 07:00:07

首先,我想说,你最好不要再使用papervision,因为该项目已经停止,不会再进一步​​开发。就此而言,最好更改为 Away3D。

话虽这么说,我确实有解决你问题的方法。其实很简单。您可以将 OBJECT_PRESS-eventListener 添加到 3D 对象,或者您可以创建一个不是 3D 对象的按钮,然后将其放置在您的视图上(如果您想要 2D 按钮)。

//If you want a 3D-object to act as a button
yourButton.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, someFunction);

//If you want a 2D-non-papervision-button to be over your view.
var yourButton:Button = new Button();
stage.addChildAt(yourButton, IndexHigherThanYourView);

First of all, I would like to say that you'd better not use papervision anymore, since that project has been stopped and will not be developed any further. It is better to change to Away3D for that matter.

That being said, I do have the solution to your problem. It is actually very simple. You can just add an OBJECT_PRESS-eventListener to a 3Dobject, or you can create a button that isn't a 3Dobject and justr place it over your view (if you want a 2D-button).

//If you want a 3D-object to act as a button
yourButton.addEventListener(InteractiveScene3DEvent.OBJECT_PRESS, someFunction);

//If you want a 2D-non-papervision-button to be over your view.
var yourButton:Button = new Button();
stage.addChildAt(yourButton, IndexHigherThanYourView);
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文