• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

Java ConfigurableEmitter类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了Java中org.newdawn.slick.particles.ConfigurableEmitter的典型用法代码示例。如果您正苦于以下问题:Java ConfigurableEmitter类的具体用法?Java ConfigurableEmitter怎么用?Java ConfigurableEmitter使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



ConfigurableEmitter类属于org.newdawn.slick.particles包,在下文中一共展示了ConfigurableEmitter类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。

示例1: update

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
public void update(GameContainer container, int delta)
		throws SlickException {
	if (!paused) {
		ypos += delta * 0.002 * systemMove;
		if (ypos > 300) {
			ypos = -300;
		}
		if (ypos < -300) {
			ypos = 300;
		}

		for (int i = 0; i < emitters.size(); i++) {
			((ConfigurableEmitter) emitters.get(i)).replayCheck();
		}
		for (int i = 0; i < delta; i++) {
			system.update(1);
		}
	}

	Display.sync(100);
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:22,代码来源:ParticleGame.java


示例2: browseForImage

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * Browse for a particle image and set the value into both the emitter and text field
 * on successful completion
 */
private void browseForImage() {
	if (emitter != null) {
		int resp = chooser.showOpenDialog(this);
		if (resp == JFileChooser.APPROVE_OPTION) {
			File file = chooser.getSelectedFile();
			String path = file.getParentFile().getAbsolutePath();
			String name = file.getName();
			
			ConfigurableEmitter.setRelativePath(path);
			emitter.setImageName(name);
			
			imageName.setText(name);
		}
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:20,代码来源:SettingsPanel.java


示例3: cloneEmitter

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * Clone the selected emitter
 */
public void cloneEmitter() {
	if (selected == null) {
		return;
	}
	
	try {
		ByteArrayOutputStream bout = new ByteArrayOutputStream();
		ParticleIO.saveEmitter(bout, selected);
		ByteArrayInputStream bin = new ByteArrayInputStream(bout.toByteArray());
		ConfigurableEmitter emitter = ParticleIO.loadEmitter(bin);
		emitter.name = emitter.name + "_clone";
		
		addEmitter(emitter);
		emitters.setSelected(emitter);
	} catch (IOException e) {
		Log.error(e);
		JOptionPane.showMessageDialog(this, e.getMessage());
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:23,代码来源:ParticleEditor.java


示例4: init

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
@Override
public void init(GameContainer container, StateBasedGame game) throws SlickException {
	try {
		this.barks = Utils.loadParticleSystem("data/particles/drawing.xml");
		this.drawingEffectEmitter = (ConfigurableEmitter)this.barks.getEmitter(0);
		this.segment = Utils.loadParticleSystem("data/particles/segment.xml");
	} catch (IOException e) {
		e.printStackTrace();
	}		
	
	this.hud.init(container, game);
	
	this.drawingPositions = new Vec2[MAX_DRAWING_LENGTH];
	for (int i = 0; i < this.drawingPositions.length; i++) this.drawingPositions[i] = new Vec2();
	this.drawings = new LinkedList<Body>();
}
 
开发者ID:intentor,项目名称:telyn,代码行数:17,代码来源:PolygonDrawer.java


示例5: init

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * load ressources (the particle system) and create our duplicate emitters
 * and place them nicely on the screen
 * @param container The surrounding game container
 */
public void init(GameContainer container) throws SlickException {
	this.container = container;
	
	try {
		// load the particle system containing our explosion emitter
		explosionSystem = ParticleIO.loadConfiguredSystem("testdata/endlessexplosion.xml");
		// get the emitter, it's the first (and only one) in this particle system
		explosionEmitter = (ConfigurableEmitter) explosionSystem.getEmitter(0);
		// set the original emitter in the middle of the screen at the top
		explosionEmitter.setPosition(400,100);
		// create 5 duplicate emitters
		for (int i = 0; i < 5; i++) {
			// a single duplicate of the first emitter is created here
			ConfigurableEmitter newOne = explosionEmitter.duplicate();
			// we might get null as a result - protect against that
			if (newOne == null)
				throw new SlickException("Failed to duplicate explosionEmitter");
			// give the new emitter a new unique name
			newOne.name = newOne.name + "_" + i;
			// place it somewhere on a row below the original emitter
			newOne.setPosition((i+1)* (800/6), 400);
			// and add it to the original particle system to get the new emitter updated and rendered
			explosionSystem.addEmitter(newOne);
		}
	} catch (IOException e) {
		throw new SlickException("Failed to load particle systems", e);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:34,代码来源:DuplicateEmitterTest.java


示例6: render

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.BasicGame#render(org.newdawn.slick.GameContainer, org.newdawn.slick.Graphics)
 */
public void render(GameContainer container, Graphics g) {
	((ConfigurableEmitter) trail.getEmitter(0)).setPosition(rx+14,ry+35);
	trail.render();
	image.draw((int) rx,(int) ry);
	
	g.translate(400, 300);
	fire.render();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:12,代码来源:PedigreeTest.java


示例7: mousePressed

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
public void mousePressed(int button, int x, int y) {
	super.mousePressed(button, x, y);
	
	for (int i=0;i<fire.getEmitterCount();i++) {
		((ConfigurableEmitter) fire.getEmitter(i)).setPosition(x - 400, y - 300, true);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:8,代码来源:PedigreeTest.java


示例8: linkEmitterToFields

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.tools.peditor.ControlPanel#linkEmitterToFields(org.newdawn.slick.particles.ConfigurableEmitter)
 */
protected void linkEmitterToFields(ConfigurableEmitter emitter) {
	link(emitter.spawnInterval, "spawnInterval");
	link(emitter.spawnCount, "spawnCount");
	link(emitter.initialSize, "initialSize");
	link(emitter.initialLife, "initialLife");
	link(emitter.speed, "speed");
	link(emitter.growthFactor, "growth");
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:12,代码来源:EmissionControls.java


示例9: linkEmitterToFields

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.tools.peditor.ControlPanel#linkEmitterToFields(org.newdawn.slick.particles.ConfigurableEmitter)
 */
protected void linkEmitterToFields(ConfigurableEmitter emitter) {
	this.emitter = emitter;

	// register the new emitter
	editor.setLinkedEmitter(emitter);

	valueMap.clear();
	linkToEmitter("Alpha", emitter.alpha);
	linkToEmitter("Size", emitter.size);
	linkToEmitter("Velocity", emitter.velocity);
	linkToEmitter("ScaleY", emitter.scaleY);

	editor.setFirstProperty();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:18,代码来源:WhiskasPanel.java


示例10: addEmitter

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * Add an emitter to the particle system held here
 * 
 * @param emitter
 *            The emitter to add
 */
public void addEmitter(ConfigurableEmitter emitter) {
	emitters.add(emitter);

	if (system == null) {
		waiting.add(emitter);
	} else {
		system.addEmitter(emitter);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:16,代码来源:ParticleGame.java


示例11: getListCellRendererComponent

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * @see javax.swing.DefaultListCellRenderer#getListCellRendererComponent(javax.swing.JList, java.lang.Object, int, boolean, boolean)
 */
public Component getListCellRendererComponent(JList list, final Object value, int index, boolean isSelected, boolean cellHasFocus) {
	JLabel label = (JLabel) super.getListCellRendererComponent(list, value, index, isSelected,
			cellHasFocus);
	
	final JCheckBox box = new JCheckBox(label.getText());
	box.setBackground(label.getBackground());
	
	box.setSelected(((ConfigurableEmitter) value).isEnabled());
	checks.put(value, box);
	
	return box;
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:16,代码来源:EmitterList.java


示例12: linkEmitterToFields

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.tools.peditor.ControlPanel#linkEmitterToFields(org.newdawn.slick.particles.ConfigurableEmitter)
 */
protected void linkEmitterToFields(ConfigurableEmitter emitter) {
	name.setText(emitter.name);
	String value = emitter.getImageName();
	if (value != null) {
		value = value.substring(value.lastIndexOf(File.separatorChar)+1);	
		imageName.setText(value);
	}
	
	link(emitter.gravityFactor, "gravity");
	link(emitter.windFactor, "wind");
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:15,代码来源:SettingsPanel.java


示例13: setCurrentEmitter

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * Set the currently selected and edited particle emitter
 * 
 * @param emitter The emitter that should be selected or null for none
 */
public void setCurrentEmitter(ConfigurableEmitter emitter) {
	this.selected = emitter;
	
	if (emitter == null) {
		emissionControls.setEnabled(false);
		settingsPanel.setEnabled(false);
		positionControls.setEnabled(false);
		colorPanel.setEnabled(false);
		limitPanel.setEnabled(false);
		whiskasPanel.setEnabled(false);
	} else {
		emissionControls.setEnabled(true);
		settingsPanel.setEnabled(true);
		positionControls.setEnabled(true);
		colorPanel.setEnabled(true);
		limitPanel.setEnabled(true);
		whiskasPanel.setEnabled(true);
		
		emissionControls.setTarget(emitter);
		settingsPanel.setTarget(emitter);
		positionControls.setTarget(emitter);
		settingsPanel.setTarget(emitter);
		colorPanel.setTarget(emitter);
		limitPanel.setTarget(emitter);
		whiskasPanel.setTarget(emitter);
	}
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:33,代码来源:ParticleEditor.java


示例14: setLinkedEmitter

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * Set the emitter that is being controlled
 *  
 * @param emitter The emitter that is configured by this panel
 */
public void setLinkedEmitter(ConfigurableEmitter emitter) {
	// set the title
	Window w = SwingUtilities.windowForComponent(this);
	if (w instanceof Frame)
		((Frame) w).setTitle("Whiskas Gradient Editor (" + emitter.name
				+ ")");

	// clear all values
	properties.removeAllItems();
	values.clear();
	panel.setInterpolator(null);
	enableControls();
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:19,代码来源:GraphEditorWindow.java


示例15: linkEmitterToFields

import org.newdawn.slick.particles.ConfigurableEmitter; //导入依赖的package包/类
/**
 * @see org.newdawn.slick.tools.peditor.ControlPanel#linkEmitterToFields(org.newdawn.slick.particles.ConfigurableEmitter)
 */
protected void linkEmitterToFields(ConfigurableEmitter emitter) {
	link(emitter.xOffset, "x");
	link(emitter.yOffset, "y");
	link(emitter.spread, "spread");
	link(emitter.angularOffset, "angularOffset");
	link(emitter.initialDistance, "initialDistance");
}
 
开发者ID:j-dong,项目名称:trashjam2017,代码行数:11,代码来源:PositionControls.java



注:本文中的org.newdawn.slick.particles.ConfigurableEmitter类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
Java HashSet类代码示例发布时间:2022-05-22
下一篇:
Java EMChat类代码示例发布时间:2022-05-22
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap