slick2d 有一个小故障。我让它在窗口上绘制的图片重复了。我在运行 Eclipse 的 Windows 7 计算机上。我正在为我的图形使用paint.net,这就是它的样子:
我会有它的图像,但我还不能,对不起。
这是我的图像代码:
/**
* Images
*/
// Title
Image title;
public static int titleX = 100;
public static int titleY = 500;
// Play Button
Image play;
public static int playX = 210;
public static int playY = 500;
// Options Button
Image options;
public static int optionsX = 310;
public static int optionsY = 500;
// Quit Button
Image quit;
public static int quitX = 410;
public static int quitY = 500;
public void init(GameContainer Gc, StateBasedGame Sbg)
throws SlickException {
/**
* Images
*/
title = new Image("gfx/main_menu/title/new_title.png");
play = new Image("gfx/main_menu/buttons/play_button.png");
options = new Image("gfx/main_menu/buttons/options_button.png");
quit = new Image("gfx/main_menu/buttons/quit_button.png");
}
public void render(GameContainer Gc, StateBasedGame Sbg, Graphics G)
throws SlickException {
/**
* Background
*/
G.setColor(Color.white);
G.fillRect(0, 0, w*s, h*s);
/**
* Images
*/
title.draw(titleY*s,titleX*s);
title.draw(playY*s,playX*s);
title.draw(optionsY*s,optionsX*s);
title.draw(quitY*s,quitX*s);
}