本文整理汇总了Java中org.newdawn.slick.Image.draw方法的典型用法代码示例。如果您正苦于以下问题:Java Image.draw方法的具体用法?Java Image.draw怎么用?Java Image.draw使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.Image
的用法示例。
在下文中一共展示了Image.draw方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: render
import org.newdawn.slick.Image; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
*/
public void render(GameContainer container, Graphics g) {
image.draw(0,0);
image.draw(500,0,200,100);
scaleMe.draw(500,100,200,100);
scaled.draw(400,500);
Image flipped = scaled.getFlippedCopy(true, false);
flipped.draw(520,500);
Image flipped2 = flipped.getFlippedCopy(false, true);
flipped2.draw(520,380);
Image flipped3 = flipped2.getFlippedCopy(true, false);
flipped3.draw(400,380);
for (int i=0;i<3;i++) {
subImage.draw(200+(i*30),300);
}
g.translate(500, 200);
g.rotate(50, 50, rot);
g.scale(0.3f,0.3f);
image.draw();
g.resetTransform();
}
示例2: render
import org.newdawn.slick.Image; //导入方法依赖的package包/类
/**
* @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
*/
public void render(GameContainer container, Graphics g) {
g.drawRect(0,0,image.getWidth(),image.getHeight());
image.draw(0,0);
image.draw(500,0,200,100);
scaleMe.draw(500,100,200,100);
scaled.draw(400,500);
Image flipped = scaled.getFlippedCopy(true, false);
flipped.draw(520,500);
Image flipped2 = flipped.getFlippedCopy(false, true);
flipped2.draw(520,380);
Image flipped3 = flipped2.getFlippedCopy(true, false);
flipped3.draw(400,380);
for (int i=0;i<3;i++) {
subImage.draw(200+(i*30),300);
}
g.translate(500, 200);
g.rotate(50, 50, rot);
g.scale(0.3f,0.3f);
image.draw();
g.resetTransform();
rotImage.setRotation(rot);
rotImage.draw(100, 200);
}
示例3: renderLives
import org.newdawn.slick.Image; //导入方法依赖的package包/类
/**
* This method draws and updates the lives of pacman
* @param g
* @param lives
* @throws SlickException
*/
private void renderLives(Graphics g, int lives) throws SlickException {
g.setColor(Color.yellow);
Image pacmanLives = new Image("data/pacman/pacman0.png");
if (lives != 0)
pacmanLives.draw(510, 1, 18, 18);
if (lives == 2 || lives == 3)
pacmanLives.draw(533, 1, 18, 18);
if (lives == 3)
pacmanLives.draw(556, 1, 18, 18);
g.drawString("LIVES: ", 450, 1);
}