當前位置: 首頁>>代碼示例>>Java>>正文


Java Image.draw方法代碼示例

本文整理匯總了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();
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:26,代碼來源:CanvasContainerTest.java

示例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);
}
 
開發者ID:j-dong,項目名稱:trashjam2017,代碼行數:30,代碼來源:ImageTest.java

示例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);
}
 
開發者ID:IngSW-unipv,項目名稱:Progetto-C,代碼行數:19,代碼來源:MazeView.java


注:本文中的org.newdawn.slick.Image.draw方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。