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


Java Emitter.pos方法代码示例

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


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

示例1: createChildren

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
		protected void createChildren() {
			
			super.createChildren();
			
			avatar = new Image( Assets.AVATARS );
			add( avatar );
			
			name = PixelScene.createText( 9 );
			add( name );

//			emitter = new BitmaskEmitter( avatar );
			emitter = new Emitter();
			emitter.pos(avatar);
			add( emitter );
		}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:17,代码来源:StartScene.java

示例2: at

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public static void at( PointF p, final float dir, final float cone, final int color, int n ) {
	
	if (n <= 0) {
		return;
	}
	
	Emitter emitter = GameScene.emitter();
	emitter.pos( p );
	
	FACTORY.color = color;
	FACTORY.dir = dir;
	FACTORY.cone = cone;
	emitter.burst( FACTORY, n );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:15,代码来源:Splash.java

示例3: link

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void link(Char ch) {
	super.link(ch);

	emitter = new Emitter();
	emitter.autoKill = false;
	emitter.pos(x + 7, y + 12);
	parent.add(emitter);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:10,代码来源:BlacksmithSprite.java

示例4: link

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void link( Char ch ) {
	super.link( ch );
	
	emitter = new Emitter();
	emitter.autoKill = false;
	emitter.pos( x + 7, y + 12 );
	parent.add( emitter );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:10,代码来源:BlacksmithSprite.java

示例5: view

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public ItemSprite view(Item item){
	view(item.image(), item.glowing());
	Emitter emitter = item.emitter();
	if (emitter != null && parent != null) {
		emitter.pos( this );
		parent.add( emitter );
		this.emitter = emitter;
	}
	return this;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:11,代码来源:ItemSprite.java

示例6: bottomEmitter

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public Emitter bottomEmitter() {
	Emitter emitter = GameScene.emitter();
	emitter.pos(x, y + height, width, 0);
	return emitter;
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:6,代码来源:CharSprite.java

示例7: update

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();

	float health = Dungeon.hero.HP;
	float shield = Dungeon.hero.SHLD;
	float max = Math.max(health + shield, Dungeon.hero.HT);

	if (!Dungeon.hero.isAlive()) {
		avatar.tint(0x000000, 0.5f);
	} else if ((health / max) < 0.3f) {
		warning += Game.elapsed * 5f * (0.4f - (health / max));
		warning %= 1f;
		avatar.tint(ColorMath.interpolate(warning, 0x660000, 0xCC0000, 0x660000), 0.5f);
	} else {
		avatar.resetColor();
	}

	hp.scale.x = health / max;
	this.shield.scale.x = (health + shield) / max;

	exp.scale.x = (width / exp.width) * Dungeon.hero.exp
			/ Dungeon.hero.maxExp();

	if (Dungeon.hero.lvl != lastLvl) {

		if (lastLvl != -1) {
			Emitter emitter = (Emitter) recycle(Emitter.class);
			emitter.revive();
			emitter.pos(27, 27);
			emitter.burst(Speck.factory(Speck.STAR), 12);
		}

		lastLvl = Dungeon.hero.lvl;
		level.text(Integer.toString(lastLvl));
		level.measure();
		level.x = PixelScene.align(27.0f - level.width() / 2);
		level.y = PixelScene.align(27.5f - level.baseLine() / 2);
	}

	int k = IronKey.curDepthQuantity;
	if (k != lastKeys) {
		lastKeys = k;
		keys.text(Integer.toString(lastKeys));
		keys.measure();
		keys.x = width - 8 - keys.width() - 18;
	}

	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy(HeroSprite.avatar(Dungeon.hero.heroClass, tier));
	}
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:55,代码来源:StatusPane.java

示例8: centerEmitter

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public Emitter centerEmitter() {
	Emitter emitter = GameScene.emitter();
	emitter.pos( center() );
	return emitter;
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:6,代码来源:CharSprite.java

示例9: bottomEmitter

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public Emitter bottomEmitter() {
	Emitter emitter = GameScene.emitter();
	emitter.pos( x, y + height, width, 0 );
	return emitter;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:6,代码来源:CharSprite.java

示例10: update

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();

	float health = Dungeon.hero.HP;
	float shield = Dungeon.hero.SHLD;
	float max = Dungeon.hero.HT;

	if (!Dungeon.hero.isAlive()) {
		avatar.tint(0x000000, 0.5f);
	} else if ((health/max) < 0.3f) {
		warning += Game.elapsed * 5f *(0.4f - (health/max));
		warning %= 1f;
		avatar.tint(ColorMath.interpolate(warning, 0x660000, 0xCC0000, 0x660000), 0.5f );
	} else {
		avatar.resetColor();
	}

	hp.scale.x = Math.max( 0, (health-shield)/max);
	shieldedHP.scale.x = health/max;
	rawShielding.scale.x = shield/max;

	exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();

	if (Dungeon.hero.lvl != lastLvl) {

		if (lastLvl != -1) {
			Emitter emitter = (Emitter)recycle( Emitter.class );
			emitter.revive();
			emitter.pos( 27, 27 );
			emitter.burst( Speck.factory( Speck.STAR ), 12 );
		}

		lastLvl = Dungeon.hero.lvl;
		level.text( Integer.toString( lastLvl ) );
		level.measure();
		level.x = 27.5f - level.width() / 2f;
		level.y = 28.0f - level.baseLine() / 2f;
		PixelScene.align(level);
	}

	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
	}
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:48,代码来源:StatusPane.java

示例11: createChildren

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
	protected void createChildren() {
		
		shield = new NinePatch( Assets.STATUS, 80, 0, 30   + 18, 0 );
		add( shield );
		
		add( new TouchArea( 0, 1, 30, 30 ) {
			@Override
			protected void onClick( NoosaInputProcessor.Touch touch ) {
				Image sprite = Dungeon.hero.sprite;
				if (!sprite.isVisible()) {
					Camera.main.focusOn( sprite );
				}
				GameScene.show( new WndHero() );
			};			
		} );
		
		btnMenu = new MenuButton();
		add( btnMenu );
		
		avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
		add( avatar );

		blood = new Emitter();
		blood.pos( avatar );
		blood.pour( BloodParticle.FACTORY, 0.3f );
		blood.autoKill = false;
		blood.on = false;
		add( blood );
		
		compass = new Compass( Dungeon.level.exit );
		add( compass );
		
		hp = new Image( Assets.HP_BAR );	
		add( hp );
		
		exp = new Image( Assets.XP_BAR );
		add( exp );
		
//		level = new BitmapText( PixelScene.font1x );
		level = createText(6);
		level.hardlight( 0xFFEBA4 );
		add( level );
		
//		depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.font1x );
		depth = createText(6);
		depth.text(Integer.toString( Dungeon.depth ));
		depth.hardlight( 0xCACFC2 );
		depth.measure();
		add( depth );
		
		Dungeon.hero.belongings.countIronKeys();
//		keys = new BitmapText( PixelScene.font1x );
		keys = createText(6);
		keys.hardlight( 0xCACFC2 );
		add( keys );
		
		danger = new DangerIndicator();
		add( danger );
		
		loot = new LootIndicator();
		add( loot );
		
		resume = new ResumeButton();
		add( resume );
		
		buffs = new BuffIndicator( Dungeon.hero );
		add( buffs );
	}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:70,代码来源:StatusPane.java

示例12: update

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
@Override
public void update() {
	super.update();
	
	if (tagDanger != danger.visible || tagLoot != loot.visible || tagResume != resume.visible) {
		
		tagDanger = danger.visible;
		tagLoot = loot.visible;
		tagResume = resume.visible;
		
		layoutTags();
	}
	
	float health = (float)Dungeon.hero.HP / Dungeon.hero.HT;
	
	if (health == 0) {
		avatar.tint( 0x000000, 0.6f );
		blood.on = false;
	} else if (health < 0.25f) {
		avatar.tint( 0xcc0000, 0.4f );
		blood.on = true;
	} else {
		avatar.resetColor();
		blood.on = false;
	}
	
	hp.scale.x = health;
	exp.scale.x = (width / exp.width) * Dungeon.hero.exp / Dungeon.hero.maxExp();
	
	if (Dungeon.hero.lvl != lastLvl) {
		
		if (lastLvl != -1) {
			Emitter emitter = (Emitter)recycle( Emitter.class );
			emitter.revive();
			emitter.pos( 27, 27 );
			emitter.burst( Speck.factory( Speck.STAR ), 12 );
		}
		
		lastLvl = Dungeon.hero.lvl;
		level.text( Integer.toString( lastLvl ) );
		level.measure();
		level.x = PixelScene.align( 27.5f - level.width() / 2 );
		level.y = PixelScene.align( 28.0f - level.baseLine() / 2 );
	}
	
	int k = IronKey.curDepthQuantity;
	if (k != lastKeys) {
		lastKeys = k;
		keys.text( Integer.toString( lastKeys ) );
		keys.measure();
		keys.x = width - 8 - keys.width()    - 18;
	}
	
	int tier = Dungeon.hero.tier();
	if (tier != lastTier) {
		lastTier = tier;
		avatar.copy( HeroSprite.avatar( Dungeon.hero.heroClass, tier ) );
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:60,代码来源:StatusPane.java

示例13: center

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public static Emitter center( int cell ) {
	
	PointF p = DungeonTilemap.tileToWorld( cell );
	
	Emitter emitter = GameScene.emitter();
	emitter.pos( p.x + DungeonTilemap.SIZE / 2, p.y + DungeonTilemap.SIZE / 2 );
	
	return emitter;
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:10,代码来源:CellEmitter.java

示例14: get

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public static Emitter get(int cell) {

		PointF p = DungeonTilemap.tileToWorld(cell);

		Emitter emitter = GameScene.emitter();
		emitter.pos(p.x, p.y, DungeonTilemap.SIZE, DungeonTilemap.SIZE);

		return emitter;
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:10,代码来源:CellEmitter.java

示例15: center

import com.watabou.noosa.particles.Emitter; //导入方法依赖的package包/类
public static Emitter center(int cell) {

		PointF p = DungeonTilemap.tileToWorld(cell);

		Emitter emitter = GameScene.emitter();
		emitter.pos(p.x + DungeonTilemap.SIZE / 2, p.y + DungeonTilemap.SIZE
				/ 2);

		return emitter;
	}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:11,代码来源:CellEmitter.java


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