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


Java RedButton.bottom方法代码示例

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


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

示例1: StatsTab

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public StatsTab() {
	super();
	
	String heroClass = Dungeon.hero.className();
	
	IconTitle title = new IconTitle();
	title.icon( HeroSprite.avatar( Dungeon.hero.heroClass, Dungeon.hero.tier() ) );
	title.label( Utils.format( TXT_TITLE, Dungeon.hero.lvl, heroClass ).toUpperCase( Locale.ENGLISH ) );
          title.color(Window.SHPX_COLOR);
	title.setRect( 0, 0, WIDTH, 0 );
	add( title );
	
	float pos = title.bottom();

          if (Dungeon.challenges > 0) {
              RedButton btnCatalogus = new RedButton( TXT_CHALLENGES ) {
                  @Override
                  protected void onClick() {
                      Game.scene().add( new WndChallenges( Dungeon.challenges, false ) );
                  }
              };
              btnCatalogus.setRect( 0, pos + GAP, btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2 );
              add( btnCatalogus );

              pos = btnCatalogus.bottom();
          }

          pos += GAP + GAP;
	
	pos = statSlot( this, TXT_STR, Integer.toString( Dungeon.hero.STR ), pos );
	pos = statSlot( this, TXT_HEALTH, Integer.toString( Dungeon.hero.HT ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, TXT_DURATION, Integer.toString( (int)Statistics.duration ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, TXT_DEPTH, Integer.toString( Statistics.deepestFloor ), pos );
	pos = statSlot( this, TXT_ENEMIES, Integer.toString( Statistics.enemiesSlain ), pos );
	pos = statSlot( this, TXT_GOLD, Integer.toString( Statistics.goldCollected ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, TXT_FOOD, Integer.toString( Statistics.foodEaten ), pos );
	pos = statSlot( this, TXT_ALCHEMY, Integer.toString( Statistics.potionsCooked ), pos );
	pos = statSlot( this, TXT_ANKHS, Integer.toString( Statistics.ankhsUsed ), pos );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:49,代码来源:WndRanking.java

示例2: WndTradeItem

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public WndTradeItem( final Item item, WndBag owner ) {
	
	super();
	
	this.owner = owner; 
	
	float pos = createDescription( item, false );
	
	if (item.quantity() == 1) {
		
		RedButton btnSell = new RedButton( Utils.format( TXT_SELL, item.price() ) ) {
			@Override
			protected void onClick() {
				sell( item );
				hide();
			}
		};
		btnSell.setRect( 0, pos + GAP, WIDTH, BTN_HEIGHT );
		add( btnSell );
		
		pos = btnSell.bottom();
		
	} else {
		
		int priceAll= item.price();
		RedButton btnSell1 = new RedButton( Utils.format( TXT_SELL_1, priceAll / item.quantity() ) ) {
			@Override
			protected void onClick() {
				sellOne( item );
				hide();
			}
		};
		btnSell1.setRect( 0, pos + GAP, WIDTH, BTN_HEIGHT );
		add( btnSell1 );
		RedButton btnSellAll = new RedButton( Utils.format( TXT_SELL_ALL, priceAll ) ) {
			@Override
			protected void onClick() {
				sell( item );
				hide();
			}
		};
		btnSellAll.setRect( 0, btnSell1.bottom() + GAP, WIDTH, BTN_HEIGHT );
		add( btnSellAll );
		
		pos = btnSellAll.bottom();
		
	}
	
	RedButton btnCancel = new RedButton( TXT_CANCEL ) {
		@Override
		protected void onClick() {
			hide();
		}
	};
	btnCancel.setRect( 0, pos + GAP, WIDTH, BTN_HEIGHT );
	add( btnCancel );
	
	resize( WIDTH, (int)btnCancel.bottom() );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:60,代码来源:WndTradeItem.java

示例3: StatsTab

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public StatsTab() {
	
	Hero hero = Dungeon.hero;

          IconTitle title = new IconTitle();
          title.icon( HeroSprite.avatar(hero.heroClass, hero.tier()) );
          title.label(Utils.format( TXT_TITLE, hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ), 9);
          title.color(Window.SHPX_COLOR);
          title.setRect( 0, 0, WIDTH, 0 );
	add(title);

	RedButton btnCatalogus = new RedButton( TXT_CATALOGUS ) {
		@Override
		protected void onClick() {
			hide();
			GameScene.show( new WndCatalogus() );
		}
	};
	btnCatalogus.setRect( 0, title.height(), btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2 );
	add( btnCatalogus );

	RedButton btnJournal = new RedButton( TXT_JOURNAL ) {
		@Override
		protected void onClick() {
			hide();
			GameScene.show( new WndJournal() );
		}
	};
	btnJournal.setRect(
		btnCatalogus.right() + 1, btnCatalogus.top(),
		btnJournal.reqWidth() + 2, btnJournal.reqHeight() + 2 );
	add( btnJournal );

	pos = btnCatalogus.bottom() + GAP;

	statSlot( TXT_STR, hero.STR() );
	statSlot( TXT_HEALTH, hero.HP + "/" + hero.HT );
	statSlot( TXT_EXP, hero.exp + "/" + hero.maxExp() );

	pos += GAP;

	statSlot( TXT_GOLD, Statistics.goldCollected );
	statSlot( TXT_DEPTH, Statistics.deepestFloor );

	pos += GAP;
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:47,代码来源:WndHero.java

示例4: WndBalance

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public WndBalance( final Weapon weapon ) {
    super();

    IconTitle titlebar = new IconTitle( weapon );
    titlebar.setRect( 0, 0, WIDTH, 0 );
    add( titlebar );

    BitmapTextMultiline tfMesage = PixelScene.createMultiline( Utils.format( TXT_CHOICE, weapon.name() ), 8 );
    tfMesage.maxWidth = WIDTH - MARGIN * 2;
    tfMesage.measure();
    tfMesage.x = MARGIN;
    tfMesage.y = titlebar.bottom() + MARGIN;
    add( tfMesage );

    float pos = tfMesage.y + tfMesage.height();

    if (weapon.imbue != Weapon.Imbue.LIGHT) {
        RedButton btnSpeed = new RedButton( TXT_LIGHT ) {
            @Override
            protected void onClick() {
                hide();
                Weightstone.this.apply( weapon, true );
            }
        };
        btnSpeed.setRect( MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT );
        add( btnSpeed );

        pos = btnSpeed.bottom();
    }

    if (weapon.imbue != Weapon.Imbue.HEAVY) {
        RedButton btnAccuracy = new RedButton( TXT_HEAVY ) {
            @Override
            protected void onClick() {
                hide();
                Weightstone.this.apply( weapon, false );
            }
        };
        btnAccuracy.setRect( MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT );
        add( btnAccuracy );

        pos = btnAccuracy.bottom();
    }

    RedButton btnCancel = new RedButton( TXT_CANCEL ) {
        @Override
        protected void onClick() {
            hide();
        }
    };
    btnCancel.setRect( MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT );
    add( btnCancel );

    resize( WIDTH, (int)btnCancel.bottom() + MARGIN );
}
 
开发者ID:wolispace,项目名称:soft-pixel-dungeon,代码行数:56,代码来源:Weightstone.java

示例5: StatsTab

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public StatsTab() {
	super();

	if (Dungeon.challenges > 0) GAP--;
	
	String heroClass = Dungeon.hero.className();
	
	IconTitle title = new IconTitle();
	title.icon( HeroSprite.avatar( Dungeon.hero.heroClass, Dungeon.hero.tier() ) );
	title.label( Messages.get(this, "title", Dungeon.hero.lvl, heroClass ).toUpperCase( Locale.ENGLISH ) );
	title.color(Window.SHPX_COLOR);
	title.setRect( 0, 0, WIDTH, 0 );
	add( title );
	
	float pos = title.bottom();

	if (Dungeon.challenges > 0) {
		RedButton btnCatalogus = new RedButton( Messages.get(this, "challenges") ) {
			@Override
			protected void onClick() {
				Game.scene().add( new WndChallenges( Dungeon.challenges, false ) );
			}
		};
		btnCatalogus.setRect( 0, pos, btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2 );
		add( btnCatalogus );

		pos = btnCatalogus.bottom();
	}

	pos += GAP + GAP;
	
	pos = statSlot( this, Messages.get(this, "str"), Integer.toString( Dungeon.hero.STR ), pos );
	pos = statSlot( this, Messages.get(this, "health"), Integer.toString( Dungeon.hero.HT ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, Messages.get(this, "duration"), Integer.toString( (int)Statistics.duration ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, Messages.get(this, "depth"), Integer.toString( Statistics.deepestFloor ), pos );
	pos = statSlot( this, Messages.get(this, "enemies"), Integer.toString( Statistics.enemiesSlain ), pos );
	pos = statSlot( this, Messages.get(this, "gold"), Integer.toString( Statistics.goldCollected ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, Messages.get(this, "food"), Integer.toString( Statistics.foodEaten ), pos );
	pos = statSlot( this, Messages.get(this, "alchemy"), Integer.toString( Statistics.potionsCooked ), pos );
	pos = statSlot( this, Messages.get(this, "ankhs"), Integer.toString( Statistics.ankhsUsed ), pos );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:51,代码来源:WndRanking.java

示例6: WndTradeItem

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public WndTradeItem( final Item item, WndBag owner ) {
	
	super();
	
	this.owner = owner;
	
	float pos = createDescription( item, false );
	
	if (item.quantity() == 1) {
		
		RedButton btnSell = new RedButton( Messages.get(this, "sell", item.price()) ) {
			@Override
			protected void onClick() {
				sell( item );
				hide();
			}
		};
		btnSell.setRect( 0, pos + GAP, WIDTH, BTN_HEIGHT );
		add( btnSell );
		
		pos = btnSell.bottom();
		
	} else {
		
		int priceAll= item.price();
		RedButton btnSell1 = new RedButton( Messages.get(this, "sell_1", priceAll / item.quantity()) ) {
			@Override
			protected void onClick() {
				sellOne( item );
				hide();
			}
		};
		btnSell1.setRect( 0, pos + GAP, WIDTH, BTN_HEIGHT );
		add( btnSell1 );
		RedButton btnSellAll = new RedButton( Messages.get(this, "sell_all", priceAll ) ) {
			@Override
			protected void onClick() {
				sell( item );
				hide();
			}
		};
		btnSellAll.setRect( 0, btnSell1.bottom() + GAP, WIDTH, BTN_HEIGHT );
		add( btnSellAll );
		
		pos = btnSellAll.bottom();
		
	}
	
	RedButton btnCancel = new RedButton( Messages.get(this, "cancel") ) {
		@Override
		protected void onClick() {
			hide();
		}
	};
	btnCancel.setRect( 0, pos + GAP, WIDTH, BTN_HEIGHT );
	add( btnCancel );
	
	resize( WIDTH, (int)btnCancel.bottom() );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:60,代码来源:WndTradeItem.java

示例7: WndBalance

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public WndBalance( final Weapon weapon ) {
	super();

	IconTitle titlebar = new IconTitle( weapon );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );

	RenderedTextMultiline tfMesage = PixelScene.renderMultiline( Messages.get(this, "choice"), 8 );
	tfMesage.maxWidth(WIDTH - MARGIN * 2);
	tfMesage.setPos(MARGIN, titlebar.bottom() + MARGIN);
	add( tfMesage );

	float pos = tfMesage.top() + tfMesage.height();

	if (weapon.imbue != Weapon.Imbue.LIGHT) {
		RedButton btnSpeed = new RedButton( Messages.get(this, "light") ) {
			@Override
			protected void onClick() {
				hide();
				Weightstone.this.apply( weapon, true );
			}
		};
		btnSpeed.setRect( MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT );
		add( btnSpeed );

		pos = btnSpeed.bottom();
	}

	if (weapon.imbue != Weapon.Imbue.HEAVY) {
		RedButton btnAccuracy = new RedButton( Messages.get(this, "heavy") ) {
			@Override
			protected void onClick() {
				hide();
				Weightstone.this.apply( weapon, false );
			}
		};
		btnAccuracy.setRect( MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT );
		add( btnAccuracy );

		pos = btnAccuracy.bottom();
	}

	RedButton btnCancel = new RedButton( Messages.get(this, "cancel") ) {
		@Override
		protected void onClick() {
			hide();
		}
	};
	btnCancel.setRect( MARGIN, pos + MARGIN, BUTTON_WIDTH, BUTTON_HEIGHT );
	add( btnCancel );

	resize( WIDTH, (int)btnCancel.bottom() + MARGIN );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:54,代码来源:Weightstone.java

示例8: StatsTab

import com.shatteredpixel.shatteredpixeldungeon.ui.RedButton; //导入方法依赖的package包/类
public StatsTab() {
	super();
	
	if (Dungeon.challenges > 0) GAP--;
	
	String heroClass = Dungeon.hero.className();
	
	IconTitle title = new IconTitle();
	title.icon( HeroSprite.avatar( Dungeon.hero.heroClass, Dungeon.hero.tier() ) );
	title.label( Messages.get(this, "title", Dungeon.hero.lvl, heroClass ).toUpperCase( Locale.ENGLISH ) );
	title.color(Window.SHPX_COLOR);
	title.setRect( 0, 0, WIDTH, 0 );
	add( title );
	
	float pos = title.bottom();

	if (Dungeon.challenges > 0) {
		RedButton btnCatalogus = new RedButton( Messages.get(this, "challenges") ) {
			@Override
			protected void onClick() {
				Game.scene().add( new WndChallenges( Dungeon.challenges, false ) );
			}
		};
		btnCatalogus.setRect( 0, pos, btnCatalogus.reqWidth() + 2, btnCatalogus.reqHeight() + 2 );
		add( btnCatalogus );

		pos = btnCatalogus.bottom();
	}

	pos += GAP + GAP;
	
	pos = statSlot( this, Messages.get(this, "str"), Integer.toString( Dungeon.hero.STR ), pos );
	pos = statSlot( this, Messages.get(this, "health"), Integer.toString( Dungeon.hero.HT ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, Messages.get(this, "duration"), Integer.toString( (int)Statistics.duration ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, Messages.get(this, "depth"), Integer.toString( Statistics.deepestFloor ), pos );
	pos = statSlot( this, Messages.get(this, "enemies"), Integer.toString( Statistics.enemiesSlain ), pos );
	pos = statSlot( this, Messages.get(this, "gold"), Integer.toString( Statistics.goldCollected ), pos );
	
	pos += GAP;
	
	pos = statSlot( this, Messages.get(this, "food"), Integer.toString( Statistics.foodEaten ), pos );
	pos = statSlot( this, Messages.get(this, "alchemy"), Integer.toString( Statistics.potionsCooked ), pos );
	pos = statSlot( this, Messages.get(this, "ankhs"), Integer.toString( Statistics.ankhsUsed ), pos );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon-gdx,代码行数:51,代码来源:WndRanking.java


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