⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 battle.java

📁 坦克游戏
💻 JAVA
字号:
/*
 * Created on 2005-2-8
 *
 * TODO To change the template for this generated file go to
 * Window - Preferences - Java - Code Style - Code Templates
 */
package components;

import java.awt.Graphics2D;
import java.awt.*;

import shape.IShape;
/**
 * @author AnSen
 * 
 * TODO To change the template for this generated type comment go to Window -
 * Preferences - Java - Code Style - Code Templates
 */
public class Battle extends GmObstacle implements IScriptRender {

	Image buffImage = null;

	/**
	 * @param shp
	 */
	public Battle(IShape shp, Image img) {
		buffImage = img;
		this.ishpframe = shp;		
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see components.IScriptRender#isRenderable(int, int, int, int)
	 */
	public boolean isRenderable(int left, int top, int width, int height) {
		return true;
	}

	/*
	 * (non-Javadoc)
	 * 
	 * @see components.GmComponent#renderImage(java.awt.Graphics2D, int, int,
	 *      int, int)
	 */
	public void renderImage(Graphics2D g2D, int left, int top, int width,
			int height) {
		
		g2D.drawImage(buffImage, 0, 0, width, height, left, top, left + width,
				top + height, null);
		//g2D.drawImage(buffImage,-left,-top,null);
		//super.renderImage(g2D,left,top,width,height);
	}
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -