我疯狂地想画一个非常简单的直肠和一个文字 以便了解它是如何与 浮滑的2D Java 图书馆合作的
这就是我要尝试的:
g.setColor(Color.green);
g.fillRect(50, 50, 50 ,50);
g.setColor(Color.orange);
g.drawString("Write something", 100, 100);
只要我画的一切 绿色或橙色, 但没有一个绿色 和另一个橙色, 因为我想做的...
有人能帮我弄清楚吗?
事先多多谢感谢
我疯狂地想画一个非常简单的直肠和一个文字 以便了解它是如何与 浮滑的2D Java 图书馆合作的
这就是我要尝试的:
g.setColor(Color.green);
g.fillRect(50, 50, 50 ,50);
g.setColor(Color.orange);
g.drawString("Write something", 100, 100);
只要我画的一切 绿色或橙色, 但没有一个绿色 和另一个橙色, 因为我想做的...
有人能帮我弄清楚吗?
事先多多谢感谢
Your code seems to be correct, and works on my test-game. Are you running it in the appropriate method, public void render(GameContainer gc, Graphics g)?
试着更新您的 LWJGL 和 Slick2D 库 。
想象一下您手工重新绘制屏幕。 你拿起绿色笔, 绘制矩形。 然后拿起橙色笔, 绘制单词。 这就是您告诉 Slick2D 用您的代码做的。 不要改变两个绘图操作之间的颜色, 只需设置颜色, 然后画出两个对象, 然后它们会以相同的颜色出来 。
当您更改所有形状/ 文本操作的颜色时, 之后的操作将会以该颜色进行, 直到您再次更改颜色 。
我还在导入 java.awt.cool;
, 这个图书馆与 Slick2D
不符 。
将 import java.awt.color;
改为 import org.newdawn.slick.color;
。
I m following the tutorials found on the Slick2D website, and upon loading Images to my program, I get an error that says: Tue Nov 01 14:12:47 EDT 2011 INFO:Slick Build #274 Tue Nov 01 14:12:47 EDT ...
I m working on a smallish game with a friend and we ran into a really annoying problem with sprite sheets and textures... Right now we re just using Slick2D s textureloader and we even tried their ...
All I know is that delta relates somehow to adapting to different frame rates, but I m not sure exactly what it stands for and how to use it in the math that calculates speeds and what not. Where is ...
So, I converted a game to Slick2D. The movement is broke, and I am at a loss. Before, we used KeyPressed and keyReleased methods, but now with Slick2D movement isn t working right. Yea, nothing has ...
I have done a little bit of basic stuff, I can tiles a grass tile across the screen evenly, I can display a transparent texture to the screen but I can t seem to find any documentation on loading ...
I m working on a really low res game that I need to zoom in to make it visible. I know I can use Graphics.scale(float x, float y) but I d like to zoom into the center. How can I scale the Graphics ...
I m trying to copy the logic of the Sonic physics engine, which was written for a fixed-timestep system (60 FPS), in a variable timestep age (Slick2D, to be precise). In the original upon pressing ...
I have tried running the code without the collision, and it works fine. But with it, I get a NullPointerException. The root of the problem has something to do with blocked[xAxis][yAxis] = true; ...