- 最后登录
- 2013-6-5
- 注册时间
- 2011-7-16
- 阅读权限
- 90
- 积分
- 6011
- 纳金币
- 5996
- 精华
- 1
|
//Multiple Texture Change
import com.cult3d.*;
import com.cult3d.world.*;
import java.awt.Image;
import java.awt.Graphics;
public class Petilia extends Thread implements Cult3Ds cript {
private String texname;
private String [] imgname;
private Texture tex;
private TextureImage img;
private int t_count;
private boolean loaded;
public Petilia() {
// Starts the thread
start();
}
public void run() {
texname = new String("navy");
imgname = new String[4];
imgname[0]="apple.gif";
imgname[1]="aqua.gif";
imgname[2]="salmon.gif";
imgname[3]="navy.gif";
tex = new Texture(texname);
img = (TextureImage)Cult.getImage(imgname[0]);
t_count=0;
loaded = true;
}
public void TextureChange(String arg) {
if(loaded) tex.setTexture(img);
t_count = t_count + 1;
if (t_count>3) t_count = 0;
img = (TextureImage)Cult.getImage(imgname[t_count]);
}
public void cult3dDestroy() {
}
}
|
|