如何用Java设计游戏界面

发布于 2024-07-11 12:05:16 字数 402 浏览 4 评论 0原文

我们是一个由设计师和程序员组成的团队。 我这个程序员对各种设计都无能为力,所以游戏的用户界面必须由设计师来创建。 我们正在考虑一个主屏幕,角色可以在其中四处走动,顶部有一个小地图,一个库存部分等。

所有这些东西都必须以看起来漂亮的方式设计,即漂亮的图形/按钮/颜色等我假设设计师将在 Photoshop/illustrator 中创建此界面的轮廓,然后将 .png 或 .jpeg 格式的文件发送给我,我会将其实现到程序中,确保按钮全部正常工作等。 我的问题是,

这是正确的方法吗? 他应该以 .png/.jpeg 格式向我发送界面布局,还是只向我发送按钮,而我必须用 java 手动编写界面的其余部分,将按钮/图标放在需要的位置等。如果那么,我该怎么做呢? 有这样做的类/框架吗?

任何指导方针都会有所帮助。 谢谢!

We're a team of a designer and a programmer. Me, the programmer, is hopeless on design of all sorts, so the user interface of the game must be created by the designer. We were thinking of a main screen, where the character walks around, a small minimap in the top, an inventory section, etc.

All these things would have to be designed in a way that looks pretty, i.e nice graphics/buttons/colors etc. I'm assuming that the designer will create an outline of this interface in photoshop/illustrator, then send me the file in .png or .jpeg format and I'll implement it into the program, making sure the buttons all work, etc.

My question is, is this the correct method for doing this? Should he send me the interface's layout in a .png/.jpeg format, or send me only the buttons and I have to code the rest of the interface manually in java, putting the buttons/icons where they need to be, etc. If so, how can I do this? Any classes/frameworks that do this?

Any guidelines at all will be helpful. Thanks!

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

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

发布评论

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

评论(6

少女七分熟 2024-07-18 12:05:16

这确实取决于一些事情..它是用于 J2ME 还是您正在考虑将其用于桌面(OpenGL/JOGL)?

对于 J2ME,您必须真正了解一些如何为内存有限的设备制作游戏。 J2ME 附带了自己可以使用的 GameCanvas 和 Sprite 相关类。 我建议您通过 google 阅读有关 J2ME 游戏开发的内容或购买一本书。 虽然有用于 J2ME 环境的 3D 库,但我从未对它印象深刻。

对于基于桌面的游戏,我建议对基于 2D 或 3D 的游戏使用某种形式的基于加速硬件的库。 学习曲线有点陡峭,但从长远来看更好。 有大量的库可以帮助您入门(例如 Jogl 和 JAva3D),您应该考虑使用一些称为场景图的库,这将帮助您提供良好的基础。 学习曲线再次陡峭,但更容易维护和开发。

关于你的设计/实现问题,看来你在这方面没有太多经验。一般来说,图形设计师/UI交互设计师会对如何为游戏提供界面有更好的理解。 他们通常会开发某种模拟,您将实现它,将与用户一起进行测试,反馈将决定您的下一步。 如果您没有某种形式的交互设计师,您或您的设计师将需要阅读相关内容。 通过界面进行交互,尤其是对于游戏来说,并不是一件容易的事情,它可以决定你的游戏的成败。

但如果您没有这方面的经验,那么在进入实施阶段之前,您绝对应该阅读一些游戏架构。 它将帮助您理解一些理论并在继续构建不可避免地被证明是完全错误的东西之前打下基础。

It really depends on a few things..Is it for J2ME or are you considering this for desktop (OpenGL/JOGL)?

For J2ME you have to really know a bit about making games for devices with constrained memory. J2ME comes with its own GameCanvas and Sprite related classes that you can utilise. I Would recommend you read up on J2ME game development either through google or buy a book. While there are 3D libraries for the J2ME environment, I have never been impressed by it.

For a desktop based game, I would recommend using some form of accelerated hardware based libraries for 2D or 3D based games. Bit of a steep learning curve but better in the long run. Plenty of libraries out there to help you get started(Jogl and JAva3D for example) You should look into using some called a scene graph, which will help you provide a good foundation to start from. Once again steep learning curve but much easier to maintain and develop with.

In regards to your design/implementation question, it seems you dont have much experience in this area.Generally graphic designers/UI interaction designer will have a better understanding of how to provide an interface for the game. They will generally develop a mock of some sort,you will implement it, a test will be done with user's and feedback will determine where you go from there. If you dont have some form of interaction designer, you or your designers will need to read up on it. Interaction through an interface,especially for games, is not an easy thing, and can make or break your game.

But it seems that you should definitely do some reading up on game architectures before proceeding to implementation phase if you do not have experience in this area. It will help you understand some theory and get a foundation before going ahead and building something which inevitably turns out to be completely wrong.

那支青花 2024-07-18 12:05:16

您已经描述了 JavaFX 的主要用例之一。 至少也已经有一个视觉设计工具。 我还在此博客上看到了一些文章,这些文章讨论了从图形设计师那里获取视觉资产并进行工作的想法与他们一起在应用程序中。

当然,您可以随时使用 Java 来完成繁重的工作。

You've described one of the primary use cases stated for JavaFX. There's at least one visual design tool already out for it as well. I've also seen articles on this blog that address the idea of taking visual assets from a graphic designer and working with them in an app.

And, of course, you can drop into Java for the heavy lifting at any point.

謸气贵蔟 2024-07-18 12:05:16

设计师还必须学习一些有关游戏开发的知识,如何生成在不同分辨率下都能正常工作的纹理,如果是平台游戏,如何创建适合动画的精灵等等。

在回答您的问题时,他可能需要同时执行这两项操作(向您发送按钮、精灵等以及全局视图以了解它们如何组合在一起)。

我建议您检查 http://www.gamedev.net/reference/http://www.gamasutra.com

The designer will also have to learn something about game development, how to produce textures that will work fine at different resolutions, if it's a platformer, to create sprites that lend themselves properly to animation and so on and so forth.

Answering your question, he'll probably need to do both (send you buttons, sprites, etc. and a global view to see how it all fits together).

I suggest you both check http://www.gamedev.net/reference/ and http://www.gamasutra.com

丑疤怪 2024-07-18 12:05:16

我建议您查看已经执行此操作的 java 游戏,以获取如何完成此操作的示例。
例如

http://sourceforge.net/projects/freecol/#item3rd-2

http://sourceforge.net/projects/megamek/#item3rd-2

< a href="http://sourceforge.net/project/screenshots.php?group_id=1111" rel="nofollow noreferrer">http://sourceforge.net/project/screenshots.php?group_id=1111

魔法少女 2024-07-18 12:05:16

想出一些奇怪的 XML 格式来完整地描述界面并让他创建它。 :)

Think up some weird XML format that completely describes the interface and make him create it. :)

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