使用 Java 的简单 2D 图形的最佳 API
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/207938/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
Best API for simple 2D graphics with Java
提问by bjwbell
I'm not sure what the best api for simple 2d graphics with Java is. I know java.awt.Graphics2D
was the standard but has it been replaced? Swing is the new API for Java GUI apps but it seems a bit heavy for what I want. What I really want is something like the C SDL library.
我不确定使用 Java 进行简单 2d 图形的最佳 api 是什么。我知道java.awt.Graphics2D
是标准,但它被取代了吗?Swing 是 Java GUI 应用程序的新 API,但对于我想要的东西来说似乎有点沉重。我真正想要的是类似于 C SDL 库的东西。
采纳答案by Chris Jester-Young
回答by Buggieboy
回答by i30817
If you want to have the least work possible if you're building a game (or even if not) use http://slick.cokeandcode.com/
如果您想在构建游戏时尽可能少地工作(或者即使不是),请使用http://slick.cokeandcode.com/
UPDATE: The link has since changed to http://slick.ninjacave.com/
更新:此链接已更改为http://slick.ninjacave.com/
回答by Spoike
Processing.orghas some good easy-to-use 2D stuff (and 3D). It has a PAppletclass that implements Applet from AWT together with a bunch of useful operations and works well together with Java2D.
Processing.org有一些很好的易于使用的 2D 内容(和 3D)。它有一个PApplet类,它实现了来自 AWT 的 Applet 以及一堆有用的操作,并且与Java2D一起工作得很好。
If you just want to mess around with 2d graphics it has a "sketchpad IDE" where you don't need to put it in your java IDE if you just want to experiment with it.
如果你只是想处理 2d 图形,它有一个“sketchpad IDE”,如果你只是想试验它,你不需要把它放在你的 java IDE 中。