本文整理汇总了Java中org.newdawn.slick.particles.ParticleSystem.getEmitter方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleSystem.getEmitter方法的具体用法?Java ParticleSystem.getEmitter怎么用?Java ParticleSystem.getEmitter使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.newdawn.slick.particles.ParticleSystem
的用法示例。
在下文中一共展示了ParticleSystem.getEmitter方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: loadSystem
import org.newdawn.slick.particles.ParticleSystem; //导入方法依赖的package包/类
/**
* Load a complete particle system XML description
*/
public void loadSystem() {
chooser.setDialogTitle("Open");
int resp = chooser.showOpenDialog(this);
if (resp == JFileChooser.APPROVE_OPTION) {
File file = chooser.getSelectedFile();
File path = file.getParentFile();
try {
ParticleSystem system = ParticleIO.loadConfiguredSystem(file);
game.setSystem(system);
emitters.clear();
for (int i=0;i<system.getEmitterCount();i++) {
final ConfigurableEmitter emitter = (ConfigurableEmitter) system.getEmitter(i);
if (emitter.getImageName() != null) {
File possible = new File(path, emitter.getImageName());
if (possible.exists()) {
emitter.setImageName(possible.getAbsolutePath());
} else {
chooser.setDialogTitle("Locate the image: "+emitter.getImageName());
FileFilter filter = new FileFilter() {
public boolean accept(File f) {
if (f.isDirectory()) {
return true;
}
return (f.getName().equals(emitter.getImageName()));
}
public String getDescription() {
return emitter.getImageName();
}
};
chooser.addChoosableFileFilter(filter);
resp = chooser.showOpenDialog(this);
if (resp == JFileChooser.APPROVE_OPTION) {
File image = chooser.getSelectedFile();
emitter.setImageName(image.getAbsolutePath());
path = image.getParentFile();
}
chooser.setDialogTitle("Open");
chooser.resetChoosableFileFilters();
chooser.addChoosableFileFilter(xmlFileFilter);
}
}
emitters.add(emitter);
}
additive.setSelected(system.getBlendingMode() == ParticleSystem.BLEND_ADDITIVE);
pointsEnabled.setSelected(system.usePoints());
emitters.setSelected(0);
} catch (IOException e) {
Log.error(e);
JOptionPane.showMessageDialog(this, e.getMessage());
}
}
}