?? gmautomatic.java
字號:
/*
* Created on 2005-3-11
*
* TODO To change the template for this generated file go to
* Window - Preferences - Java - Code Style - Code Templates
*/
package components;
import java.util.Vector;
import java.awt.Image;
/**
* @author Emtry Immortal
*
* 動畫效果
*/
public abstract class GmAutomatic extends GmComponent {
protected int iCurrFrame = 0;
protected int iMaxFrames = 1;
protected boolean isPlaying = false;
protected Image[] images = null;
/**
* @param life
* @param ptX
* @param ptY
* @param container
*/
public GmAutomatic(long life, double ptX, double ptY, Vector container) {
super(life, ptX, ptY, container);
}
/*
* (non-Javadoc)
*
* @see components.GmComponent#updateOject()
*/
public void updateOject() {
if (isPlaying) {
iCurrFrame = (iCurrFrame + 1) % iMaxFrames;
}
super.updateOject();
}
/**
* @return Returns the iFrameNum.
*/
public int getCurrFrame() {
return iCurrFrame;
}
/**
* @param frameNum
* The iFrameNum to set.
*/
public void setFrameNum(int frameNum) {
iCurrFrame = frameNum;
}
public void play() {
isPlaying = true;
}
public void pause() {
isPlaying = false;
}
/*
* (non-Javadoc)
*
* @see components.GmComponent#isSuperpose(int, int, int, int)
*/
public boolean isSuperpose(int left, int top, int width, int height) {
if (this.ptX > left && this.ptX < (left + width) && this.ptY > top
&& this.ptY < (top + height)) {
return true;
}
return false;
}
}
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -