lpsprite.java

来自「这个是用j2me开发的.而且可以直接运行.只要相应的模拟器!」· Java 代码 · 共 60 行

JAVA
60
字号
/**
 * <p>Title: lipeng</p>
 * <p>Description:
 * You cannot remove this copyright and notice.
 * You cannot use this file without the express permission of the author.
 * All Rights Reserved</p>
 * <p>Copyright: lizhenpeng (c) 2004</p>
 * <p>Company: LP&P</p>
 * @author lizhenpeng
 * @version 1.1.0
 * <p>
 * Revise History
 * 2004.08.12 add 2 member function for save data and read data
 * change data member access level V1.1.0
 * </p>
 */

package lipeng;
import java.io.DataInputStream;
import java.io.DataOutputStream;
import java.io.IOException;


public class LPSprite
{
  public int x;
  public int y;
  public int frameCnt;
  public boolean isHidden;
  protected int timeCnt;
  protected int offset;
  public void action()
  {
  }
  public void reInit(int x,int y)
  {
    this.x=x;
    this.y=y;
    isHidden=false;
  }
  public void writeData(DataOutputStream dos) throws IOException
  {
    dos.writeInt(x);
    dos.writeInt(y);
    dos.writeInt(frameCnt);
    dos.writeBoolean(isHidden);
    dos.writeInt(timeCnt);
    dos.writeInt(offset);
  }
  public void readData(DataInputStream dis) throws IOException
  {
    x = dis.readInt();
    y = dis.readInt();
    frameCnt = dis.readInt();
    isHidden = dis.readBoolean();
    timeCnt = dis.readInt();
    offset = dis.readInt();
  }
}

⌨️ 快捷键说明

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