JavaFX 2.0 与 LibGDX(或其他)

发布于 2025-01-07 15:37:59 字数 193 浏览 5 评论 0原文

JavaFX 2.0 最近引起了我的注意。我想将它用于我的 GUI 并使用像 LibGDX 这样的图形库进行渲染。具体来说,我正在制作一个小型玩具游戏引擎。 JavaFX 具有我想要的令人惊叹的 GUI,但似乎不具备我想要的所有图形功能。所以我想使用LibGDX之类的其他东西来进行渲染。

这可能吗,还是我只能使用 Prism?

提前致谢。

JavaFX 2.0 has recently caught my attention. I'd like to use it for my GUI and use a graphics library like LibGDX for the rendering. To be specific, I'm making a small toy game engine. JavaFX has the amazing GUI that I want, but doesn't seem to have all the graphics capabilities that I would like. So I want to use something else like LibGDX for rendering.

Is this possible, or am I stuck with Prism?

Thanks in advance.

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

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

发布评论

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

评论(2

海的爱人是光 2025-01-14 15:37:59

您可以使用 scene2d 创建用户界面,libGDX 引擎库中也包含一组库 ( http://code.google.com/p/libgdx/wiki/scene2d)。您需要做的就是创建该库的 Actor 并将其添加到您的舞台/场景/屏幕上。之后,对你的actor应用一些Actions,你将得到与JavaFX或Flash相同的效果。如果您需要一个无法在应用程序的渲染中运行的特殊操作,并且需要将此操作封装在 Actor 中,请创建一个新的 Actor 来实现您的主要对象(标签、文本按钮等)并覆盖方法 act 和 draw 来实现您自己的 Actor。

libGDX 与 JavaFX 不兼容(我认为),在 LibGDX 中创建所有应用程序是一个很好的交易。

You can create your user interface with scene2d, a set of libraries also included on libGDX engine-libraries (http://code.google.com/p/libgdx/wiki/scene2d). All you need to do is create an Actor of this library and add it on your stage/scene/screen. After that, apply some Actions to your actor and you will get the same effect that with JavaFX or Flash. If you need a special action that you can't run in the render of your app and you need to encapsulate this action in your Actor, create a new actor that implements your primary object (label, textbutton,...) and override the method act and draw to implement your own Actor.

libGDX is not compatible (I think) with JavaFX, create all the app in LibGDX, is a good deal.

墨离汐 2025-01-14 15:37:59

根据 Libgdx + JavaFX 论坛帖子,听起来像尽管人们在让 libGDX 在 JavaFX 应用程序中工作方面取得了进展。

具体来说,提到了以下两个存储库:

  1. https://bitbucket.org/xpenatan/libgdx-javafx
  2. https://github.com/Trixt0r/LibGDX-FX

Per the Libgdx + JavaFX forum thread, it sounds as though people have made progress getting libGDX working within a JavaFX application.

Specifically, the following two repos are mentioned:

  1. https://bitbucket.org/xpenatan/libgdx-javafx
  2. https://github.com/Trixt0r/LibGDX-FX
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文