當前位置: 首頁>>代碼示例>>Java>>正文


Java GnollTricksterSprite類代碼示例

本文整理匯總了Java中com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite的典型用法代碼示例。如果您正苦於以下問題:Java GnollTricksterSprite類的具體用法?Java GnollTricksterSprite怎麽用?Java GnollTricksterSprite使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。


GnollTricksterSprite類屬於com.shatteredpixel.shatteredpixeldungeon.sprites包,在下文中一共展示了GnollTricksterSprite類的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。

示例1: WndSadGhost

import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite; //導入依賴的package包/類
public WndSadGhost( final Ghost ghost, final int type ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
       BitmapTextMultiline message;
       switch (type){
           case 1:default:
               titlebar.icon( new FetidRatSprite() );
               titlebar.label( "DEFEATED FETID RAT" );
               message = PixelScene.createMultiline( TXT_RAT+TXT_GIVEITEM, 6 );
               break;
           case 2:
               titlebar.icon( new GnollTricksterSprite() );
               titlebar.label( "DEFEATED GNOLL TRICKSTER" );
               message = PixelScene.createMultiline( TXT_GNOLL+TXT_GIVEITEM, 6 );
               break;
           case 3:
               titlebar.icon( new GreatCrabSprite());
               titlebar.label( "DEFEATED GREAT CRAB" );
               message = PixelScene.createMultiline( TXT_CRAB+TXT_GIVEITEM, 6 );
               break;

       }


	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );

	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnWeapon = new RedButton( TXT_WEAPON ) {
		@Override
		protected void onClick() {
			selectReward( ghost, Ghost.Quest.weapon );
		}
	};
	btnWeapon.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnWeapon );

       if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) {
           RedButton btnArmor = new RedButton(TXT_ARMOR) {
               @Override
               protected void onClick() {
                   selectReward(ghost, Ghost.Quest.armor);
               }
           };
           btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT);
           add(btnArmor);

           resize(WIDTH, (int) btnArmor.bottom());
       } else {
           resize(WIDTH, (int) btnWeapon.bottom());
       }
}
 
開發者ID:wolispace,項目名稱:soft-pixel-dungeon,代碼行數:59,代碼來源:WndSadGhost.java

示例2: WndSadGhost

import com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite; //導入依賴的package包/類
public WndSadGhost( final Ghost ghost, final int type ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	RenderedTextMultiline message;
	switch (type){
		case 1:default:
			titlebar.icon( new FetidRatSprite() );
			titlebar.label( Messages.get(this, "rat_title") );
			message = PixelScene.renderMultiline( Messages.get(this, "rat")+Messages.get(this, "give_item"), 6 );
			break;
		case 2:
			titlebar.icon( new GnollTricksterSprite() );
			titlebar.label( Messages.get(this, "gnoll_title") );
			message = PixelScene.renderMultiline( Messages.get(this, "gnoll")+Messages.get(this, "give_item"), 6 );
			break;
		case 3:
			titlebar.icon( new GreatCrabSprite());
			titlebar.label( Messages.get(this, "crab_title") );
			message = PixelScene.renderMultiline( Messages.get(this, "crab")+Messages.get(this, "give_item"), 6 );
			break;

	}

	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );

	message.maxWidth(WIDTH);
	message.setPos(0, titlebar.bottom() + GAP);
	add( message );
	
	RedButton btnWeapon = new RedButton( Messages.get(this, "weapon") ) {
		@Override
		protected void onClick() {
			selectReward( ghost, Ghost.Quest.weapon );
		}
	};
	btnWeapon.setRect( 0, message.top() + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnWeapon );

	if (!Dungeon.isChallenged( Challenges.NO_ARMOR )) {
		RedButton btnArmor = new RedButton( Messages.get(this, "armor") ) {
			@Override
			protected void onClick() {
				selectReward(ghost, Ghost.Quest.armor);
			}
		};
		btnArmor.setRect(0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT);
		add(btnArmor);

		resize(WIDTH, (int) btnArmor.bottom());
	} else {
		resize(WIDTH, (int) btnWeapon.bottom());
	}
}
 
開發者ID:00-Evan,項目名稱:shattered-pixel-dungeon,代碼行數:57,代碼來源:WndSadGhost.java


注:本文中的com.shatteredpixel.shatteredpixeldungeon.sprites.GnollTricksterSprite類示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。