本文整理汇总了Java中com.shatteredpixel.shatteredpixeldungeon.windows.WndHero类的典型用法代码示例。如果您正苦于以下问题:Java WndHero类的具体用法?Java WndHero怎么用?Java WndHero使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
WndHero类属于com.shatteredpixel.shatteredpixeldungeon.windows包,在下文中一共展示了WndHero类的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: examineObject
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //导入依赖的package包/类
public static void examineObject(Object o){
if (o == Dungeon.hero){
GameScene.show( new WndHero() );
} else if ( o instanceof Mob ){
GameScene.show(new WndInfoMob((Mob) o));
} else if ( o instanceof Heap ){
Heap heap = (Heap)o;
if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) {
GameScene.show(new WndTradeItem(heap, false));
} else {
GameScene.show(new WndInfoItem(heap));
}
} else if ( o instanceof Plant ){
GameScene.show( new WndInfoPlant((Plant) o) );
} else if ( o instanceof Trap ){
GameScene.show( new WndInfoTrap((Trap) o));
} else {
GameScene.show( new WndMessage( Messages.get(GameScene.class, "dont_know") ) ) ;
}
}
示例2: onSelect
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //导入依赖的package包/类
@Override
public void onSelect( Integer cell ) {
if (cell == null) {
return;
}
if (cell < 0 || cell > Level.LENGTH || (!Dungeon.level.visited[cell] && !Dungeon.level.mapped[cell])) {
GameScene.show( new WndMessage( "You don't know what is there." ) ) ;
return;
}
if (!Dungeon.visible[cell]) {
GameScene.show( new WndInfoCell( cell ) );
return;
}
if (cell == Dungeon.hero.pos) {
GameScene.show( new WndHero() );
return;
}
Mob mob = (Mob)Actor.findChar( cell );
if (mob != null) {
GameScene.show( new WndInfoMob( mob ) );
return;
}
Heap heap = Dungeon.level.heaps.get( cell );
if (heap != null) {
if (heap.type == Heap.Type.FOR_SALE && heap.size() == 1 && heap.peek().price() > 0) {
GameScene.show( new WndTradeItem( heap, false ) );
} else {
GameScene.show( new WndInfoItem( heap ) );
}
return;
}
Plant plant = Dungeon.level.plants.get( cell );
if (plant != null) {
GameScene.show( new WndInfoPlant( plant ) );
return;
}
GameScene.show( new WndInfoCell( cell ) );
}
示例3: createChildren
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //导入依赖的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( 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.hardlight( 0xFFEBA4 );
add( level );
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.font1x );
depth.hardlight( 0xCACFC2 );
depth.measure();
add( depth );
Dungeon.hero.belongings.countIronKeys();
keys = new BitmapText( PixelScene.font1x );
keys.hardlight( 0xCACFC2 );
add( keys );
danger = new DangerIndicator();
add( danger );
resume = new ResumeIndicator();
add ( resume );
loot = new LootIndicator();
add( loot );
buffs = new BuffIndicator( Dungeon.hero );
add( buffs );
}
示例4: createChildren
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //导入依赖的package包/类
@Override
protected void createChildren() {
bg = new NinePatch( Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0 );
add( bg );
add( new TouchArea( 0, 1, 31, 31 ) {
@Override
protected void onClick( Touch touch ) {
Image sprite = Dungeon.hero.sprite;
if (!sprite.isVisible()) {
Camera.main.focusOn( sprite );
}
GameScene.show( new WndHero() );
}
} );
btnJournal = new JournalButton();
add( btnJournal );
btnMenu = new MenuButton();
add( btnMenu );
avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
add( avatar );
compass = new Compass( Statistics.amuletObtained ? Dungeon.level.entrance : Dungeon.level.exit );
add( compass );
rawShielding = new Image( Assets.SHLD_BAR );
rawShielding.alpha(0.5f);
add(rawShielding);
shieldedHP = new Image( Assets.SHLD_BAR );
add(shieldedHP);
hp = new Image( Assets.HP_BAR );
add( hp );
exp = new Image( Assets.XP_BAR );
add( exp );
bossHP = new BossHealthBar();
add( bossHP );
level = new BitmapText( PixelScene.pixelFont);
level.hardlight( 0xFFEBA4 );
add( level );
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
depth.hardlight( 0xCACFC2 );
depth.measure();
add( depth );
danger = new DangerIndicator();
add( danger );
buffs = new BuffIndicator( Dungeon.hero );
add( buffs );
add( pickedUp = new Toolbar.PickedUpItem());
}
示例5: createChildren
import com.shatteredpixel.shatteredpixeldungeon.windows.WndHero; //导入依赖的package包/类
@Override
protected void createChildren() {
bg = new NinePatch( Assets.STATUS, 0, 0, 128, 36, 85, 0, 45, 0 );
add( bg );
add( new TouchArea<GameAction>( 0, 1, 31, 31 ) {
@Override
protected void onClick( NoosaInputProcessor.Touch touch ) {
Image sprite = Dungeon.hero.sprite;
if (!sprite.isVisible()) {
Camera.main.focusOn( sprite );
}
GameScene.show( new WndHero() );
}
@Override
public boolean onKeyUp(NoosaInputProcessor.Key<GameAction> key) {
boolean handled = true;
switch (key.action) {
case HERO_INFO:
onClick( null );
break;
case JOURNAL:
GameScene.show( new WndJournal() );
break;
default:
handled = false;
break;
}
return handled;
}
} );
btnJournal = new JournalButton();
add( btnJournal );
btnMenu = new MenuButton();
add( btnMenu );
avatar = HeroSprite.avatar( Dungeon.hero.heroClass, lastTier );
add( avatar );
compass = new Compass( Statistics.amuletObtained ? Dungeon.level.entrance : Dungeon.level.exit );
add( compass );
rawShielding = new Image( Assets.SHLD_BAR );
rawShielding.alpha(0.5f);
add(rawShielding);
shieldedHP = new Image( Assets.SHLD_BAR );
add(shieldedHP);
hp = new Image( Assets.HP_BAR );
add( hp );
exp = new Image( Assets.XP_BAR );
add( exp );
bossHP = new BossHealthBar();
add( bossHP );
level = new BitmapText( PixelScene.pixelFont);
level.hardlight( 0xFFEBA4 );
add( level );
depth = new BitmapText( Integer.toString( Dungeon.depth ), PixelScene.pixelFont);
depth.hardlight( 0xCACFC2 );
depth.measure();
add( depth );
danger = new DangerIndicator();
add( danger );
buffs = new BuffIndicator( Dungeon.hero );
add( buffs );
add( pickedUp = new Toolbar.PickedUpItem());
}