当前位置: 首页>>代码示例>>Java>>正文


Java ParticleEmitter.setImagePath方法代码示例

本文整理汇总了Java中com.badlogic.gdx.graphics.g2d.ParticleEmitter.setImagePath方法的典型用法代码示例。如果您正苦于以下问题:Java ParticleEmitter.setImagePath方法的具体用法?Java ParticleEmitter.setImagePath怎么用?Java ParticleEmitter.setImagePath使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.badlogic.gdx.graphics.g2d.ParticleEmitter的用法示例。


在下文中一共展示了ParticleEmitter.setImagePath方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: loadImage

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
private void loadImage (ParticleEmitter emitter) {
	final String imagePath = emitter.getImagePath();
	String imageName = new File(imagePath.replace('\\', '/')).getName();
	try {
		FileHandle file;
		if (imagePath.equals(ParticleEditor.DEFAULT_PARTICLE) || imagePath.equals(ParticleEditor.DEFAULT_PREMULT_PARTICLE))
			file = Gdx.files.classpath(imagePath);
		else
			file = Gdx.files.absolute(imagePath);
		emitter.setSprite(new Sprite(new Texture(file)));
	} catch (GdxRuntimeException ex) {
		ex.printStackTrace();
		EventQueue.invokeLater(new Runnable() {
			public void run () {
				JOptionPane.showMessageDialog(ParticleEditor.this, "Error loading image:\n" + imagePath);
			}
		});
		emitter.setImagePath(null);
	}
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:21,代码来源:ParticleEditor.java

示例2: newEmitter

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
public ParticleEmitter newEmitter (String name, boolean select) {
	final ParticleEmitter emitter = new ParticleEmitter();

	emitter.getDuration().setLow(1000);
	emitter.getEmission().setHigh(50);
	emitter.getLife().setHigh(500);
	emitter.getScale().setHigh(32, 32);

	emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});
	emitter.getTransparency().setHigh(1);

	emitter.setMaxParticleCount(25);
	emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE);

	addEmitter(name, select, emitter);
	return emitter;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:18,代码来源:EffectPanel.java

示例3: newEmitter

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
public ParticleEmitter newEmitter (String name, boolean select) {
	final ParticleEmitter emitter = new ParticleEmitter();

	emitter.getDuration().setLow(1000);
	emitter.getEmission().setHigh(50);
	emitter.getLife().setHigh(500);
	emitter.getScale().setHigh(32, 32);

	emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});
	emitter.getTransparency().setHigh(1);

	emitter.setFlip(false, true);
	emitter.setMaxParticleCount(25);
	emitter.setImagePath("particle.png");

	addEmitter(name, select, emitter);
	return emitter;
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:19,代码来源:EffectPanel.java

示例4: loadImage

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
private void loadImage (ParticleEmitter emitter) {
	final String imagePath = emitter.getImagePath();
	String imageName = new File(imagePath.replace('\\', '/')).getName();
	try {
		FileHandle file;
		if (imagePath.equals("particle.png"))
			file = Gdx.files.classpath(imagePath);
		else
			file = Gdx.files.absolute(imagePath);
		emitter.setSprite(new Sprite(new Texture(file)));
	} catch (GdxRuntimeException ex) {
		ex.printStackTrace();
		EventQueue.invokeLater(new Runnable() {
			public void run () {
				JOptionPane.showMessageDialog(ParticleRenderer.this.particlePanel, "Error loading image:\n" + imagePath);
			}
		});
		emitter.setImagePath(null);
	}
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:21,代码来源:ParticleRenderer.java

示例5: loadImage

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
private void loadImage (ParticleEmitter emitter) {
	final String imagePath = emitter.getImagePath();
	String imageName = new File(imagePath.replace('\\', '/')).getName();
	try {
		FileHandle file;
		if (imagePath.equals("particle.png"))
			file = Gdx.files.classpath(imagePath);
		else
			file = Gdx.files.absolute(imagePath);
		emitter.setSprite(new Sprite(new Texture(file)));
	} catch (GdxRuntimeException ex) {
		ex.printStackTrace();
		EventQueue.invokeLater(new Runnable() {
			public void run () {
				JOptionPane.showMessageDialog(ParticleEditor.this, "Error loading image:\n" + imagePath);
			}
		});
		emitter.setImagePath(null);
	}
}
 
开发者ID:tjumyk,项目名称:touhou-java,代码行数:21,代码来源:ParticleEditor.java

示例6: newExampleEmitter

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
public ParticleEmitter newExampleEmitter (String name, boolean select) {
	final ParticleEmitter emitter = new ParticleEmitter();

	emitter.getDuration().setLow(3000);

	emitter.getEmission().setHigh(250);

	emitter.getLife().setHigh(500, 1000);
	emitter.getLife().setTimeline(new float[] {0, 0.66f, 1});
	emitter.getLife().setScaling(new float[] {1, 1, 0.3f});

	emitter.getScale().setHigh(32, 32);

	emitter.getRotation().setLow(1, 360);
	emitter.getRotation().setHigh(180, 180);
	emitter.getRotation().setTimeline(new float[] {0, 1});
	emitter.getRotation().setScaling(new float[] {0, 1});
	emitter.getRotation().setRelative(true);

	emitter.getAngle().setHigh(45, 135);
	emitter.getAngle().setLow(90);
	emitter.getAngle().setTimeline(new float[] {0, 0.5f, 1});
	emitter.getAngle().setScaling(new float[] {1, 0, 0});
	emitter.getAngle().setActive(true);

	emitter.getVelocity().setHigh(30, 300);
	emitter.getVelocity().setActive(true);

	emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});

	emitter.getTransparency().setHigh(1, 1);
	emitter.getTransparency().setTimeline(new float[] {0, 0.2f, 0.8f, 1});
	emitter.getTransparency().setScaling(new float[] {0, 1, 0.75f, 0});

	emitter.setMaxParticleCount(200);
	emitter.setImagePath(ParticleEditor.DEFAULT_PARTICLE);

	addEmitter(name, select, emitter);
	return emitter;
}
 
开发者ID:basherone,项目名称:libgdxcn,代码行数:41,代码来源:EffectPanel.java

示例7: newExampleEmitter

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
public ParticleEmitter newExampleEmitter (String name, boolean select) {
	final ParticleEmitter emitter = new ParticleEmitter();
	
	emitter.getDuration().setLow(3000);
	
	emitter.getEmission().setHigh(250);
	
	emitter.getLife().setHigh(500, 1000);
	emitter.getLife().setTimeline(new float[] {0, 0.66f, 1});
	emitter.getLife().setScaling(new float[] {1, 1, 0.3f});
	
	emitter.getScale().setHigh(32, 32);
	
	emitter.getRotation().setLow(1, 360);
	emitter.getRotation().setHigh(180, 180);
	emitter.getRotation().setTimeline(new float[] {0, 1});
	emitter.getRotation().setScaling(new float[] {0, 1});
	emitter.getRotation().setRelative(true);
	
	emitter.getAngle().setHigh(45, 135);
	emitter.getAngle().setLow(90);
	emitter.getAngle().setTimeline(new float[] {0, 0.5f, 1});
	emitter.getAngle().setScaling(new float[] {1, 0, 0});
	emitter.getAngle().setActive(true);
	
	emitter.getVelocity().setHigh(30, 300);
	emitter.getVelocity().setActive(true);
	
	emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});
	
	emitter.getTransparency().setHigh(1, 1);
	emitter.getTransparency().setTimeline(new float[] {0, 0.2f, 0.8f, 1});
	emitter.getTransparency().setScaling(new float[] {0, 1, 0.75f, 0});
	
	emitter.setFlip(false, true);
	emitter.setMaxParticleCount(200);
	emitter.setImagePath("particle.png");
	
	addEmitter(name, select, emitter);
	return emitter;
}
 
开发者ID:pyros2097,项目名称:GdxStudio,代码行数:42,代码来源:EffectPanel.java

示例8: newEmitter

import com.badlogic.gdx.graphics.g2d.ParticleEmitter; //导入方法依赖的package包/类
public ParticleEmitter newEmitter (String name, boolean select) {
	final ParticleEmitter emitter = new ParticleEmitter();

	emitter.getDuration().setLow(3000);

	emitter.getEmission().setHigh(250);

	emitter.getLife().setHigh(500, 1000);
	emitter.getLife().setTimeline(new float[] {0, 0.66f, 1});
	emitter.getLife().setScaling(new float[] {1, 1, 0.3f});

	emitter.getScale().setHigh(32, 32);

	emitter.getRotation().setLow(1, 360);
	emitter.getRotation().setHigh(180, 180);
	emitter.getRotation().setTimeline(new float[] {0, 1});
	emitter.getRotation().setScaling(new float[] {0, 1});
	emitter.getRotation().setRelative(true);

	emitter.getAngle().setHigh(45, 135);
	emitter.getAngle().setLow(90);
	emitter.getAngle().setTimeline(new float[] {0, 0.5f, 1});
	emitter.getAngle().setScaling(new float[] {1, 0, 0});
	emitter.getAngle().setActive(true);

	emitter.getVelocity().setHigh(30, 300);
	emitter.getVelocity().setActive(true);

	emitter.getTint().setColors(new float[] {1, 0.12156863f, 0.047058824f});

	emitter.getTransparency().setHigh(1, 1);
	emitter.getTransparency().setTimeline(new float[] {0, 0.2f, 0.8f, 1});
	emitter.getTransparency().setScaling(new float[] {0, 1, 0.75f, 0});

	emitter.setFlip(false, true);
	emitter.setMaxParticleCount(200);
	emitter.setImagePath("particle.png");

	Array<ParticleEmitter> emitters = editor.effect.getEmitters();
	if (emitters.size == 0)
		emitter.setPosition(editor.worldCamera.viewportWidth / 2, editor.worldCamera.viewportHeight / 2);
	else {
		ParticleEmitter p = emitters.get(0);
		emitter.setPosition(p.getX(), p.getY());
	}
	emitters.add(emitter);

	emitterTableModel.addRow(new Object[] {name, true});
	if (select) {
		editor.reloadRows();
		int row = emitterTableModel.getRowCount() - 1;
		emitterTable.getSelectionModel().setSelectionInterval(row, row);
	}
	return emitter;
}
 
开发者ID:tjumyk,项目名称:touhou-java,代码行数:56,代码来源:EffectPanel.java


注:本文中的com.badlogic.gdx.graphics.g2d.ParticleEmitter.setImagePath方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。