• 如果您觉得本站非常有看点,那么赶紧使用Ctrl+D 收藏吧

Java ItemSprite类的典型用法和代码示例

java 1次浏览

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

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

示例1: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
		protected void createChildren() {
			
			super.createChildren();
			
			shield = new ItemSprite( ItemSpriteSheet.TOMB, null );
			add( shield );
			
//			position = new BitmapText( PixelScene.font1x );
			position  = createText(6);
			add( position );
			
			desc = createMultiline( 9 );		
			add( desc );
			
			classIcon = new Image();
			add( classIcon );
		}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:19,
代码来源:RankingsScene.java

示例2: fillFields

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private void fillFields( int image, ItemSprite.Glowing glowing, int titleColor, String title, String info ) {
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( image, glowing ) );
	titlebar.label( Utils.capitalize( title ), titleColor );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline txtInfo = PixelScene.createMultiline( info, 6 );
	txtInfo.maxWidth = WIDTH;
	txtInfo.measure();
	txtInfo.x = titlebar.left();
	txtInfo.y = titlebar.bottom() + GAP;
	add( txtInfo );
	
	resize( WIDTH, (int)(txtInfo.y + txtInfo.height()) );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:18,
代码来源:WndInfoItem.java

示例3: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
	protected void createChildren() {
		
		super.createChildren();
		
		icon = new ItemSprite();
		add( icon );
		
//		topLeft = new BitmapText( PixelScene.font1x );
		topLeft = createText(6);
		add( topLeft );
		
//		topRight = new BitmapText( PixelScene.font1x );
		topRight = createText(6);
		add( topRight );
		
//		bottomRight = new BitmapText( PixelScene.font1x );
		bottomRight = createText(6);
		add( bottomRight );
	}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:21,
代码来源:ItemSlot.java

示例4: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
	
	super.createChildren();
	
	shield = new ItemSprite( ItemSpriteSheet.TOMB, null );
	add( shield );
	
	position = new BitmapText( PixelScene.font1x );
	add( position );
	
	desc = createMultiline( 9 );		
	add( desc );
	
	classIcon = new Image();
	add( classIcon );
}
 

开发者ID:HalcyonFish,
项目名称:OHSCompSciClubPixelDungeon,
代码行数:18,
代码来源:RankingsScene.java

示例5: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
	
	super.createChildren();
	
	icon = new ItemSprite();
	add( icon );
	
	topLeft = new BitmapText( PixelScene.font1x );
	add( topLeft );
	
	topRight = new BitmapText( PixelScene.font1x );
	add( topRight );
	
	bottomRight = new BitmapText( PixelScene.font1x );
	add( bottomRight );
}
 

开发者ID:HalcyonFish,
项目名称:OHSCompSciClubPixelDungeon,
代码行数:18,
代码来源:ItemSlot.java

示例6: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {

    super.createChildren();

    shield = new ItemSprite(ItemSpriteSheet.TOMB, null);
    add(shield);

    position = new BitmapText(PixelScene.font1x);
    add(position);

    desc = createMultiline(9);
    add(desc);

    classIcon = new Image();
    add(classIcon);
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:18,
代码来源:RankingsScene.java

示例7: createDescription

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private float createDescription( Item item, boolean forSale ) {
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( item.image(), item.glowing() ) );
	titlebar.label( forSale ? 
		Utils.format( TXT_SALE, item.toString(), price( item ) ) : 
		Utils.capitalize( item.toString() ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	if (item.levelKnown && item.level > 0) {
		titlebar.color( ItemSlot.UPGRADED );	
	} else if (item.levelKnown && item.level < 0) {
		titlebar.color( ItemSlot.DEGRADED );	
	}
	
	BitmapTextMultiline info = PixelScene.createMultiline( item.info(), 6 );
	info.maxWidth = WIDTH;
	info.measure();
	info.x = titlebar.left();
	info.y = titlebar.bottom() + GAP;
	add( info );
	
	return info.y + info.height();
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:26,
代码来源:WndTradeItem.java

示例8: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {

    super.createChildren();

    icon = new ItemSprite();
    add(icon);

    topLeft = new BitmapText(PixelScene.font1x);
    add(topLeft);

    topRight = new BitmapText(PixelScene.font1x);
    add(topRight);

    bottomRight = new BitmapText(PixelScene.font1x);
    add(bottomRight);
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:18,
代码来源:ItemSlot.java

示例9: infoHeader

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public static EntryHeader infoHeader(String category, String clazz) {
	EntryHeader ret = new EntryHeader();
	if(category.equals(ITEM)) {
		Item item = ItemFactory.itemByName(clazz);
		ret.header = Utils.capitalize(item.name());
		ret.icon = new ItemSprite(item);
		return ret;
	}

	if(category.equals(MOB)) {
		Mob mob = MobFactory.mobByName(clazz);
		ret.header = Utils.capitalize(mob.getName());
		ret.icon = new CompositeTextureImage();
		((CompositeTextureImage)ret.icon).copy(mob.sprite().avatar());
		return ret;
	}

	throw new TrackedRuntimeException("unknown category: "+category);
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:20,
代码来源:Library.java

示例10: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {

    super.createChildren();

    shield = new ItemSprite(ItemSpriteSheet.TOMB, null);
    add(shield);

    position = new BitmapText(PixelScene.font1x);
    add(position);

    desc = createMultiline(GuiProperties.regularFontSize());
    add(desc);

    classIcon = new Image();
    add(classIcon);
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:18,
代码来源:RankingsScene.java

示例11: CatalogusListItem

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public CatalogusListItem(Class<? extends Item> cl) {
	super();

	try {
		item = cl.newInstance();
		if (clickable = item.isIdentified()) {
			sprite.copy(new ItemSprite(item));
			label.text(item.name());
		} else {
			sprite.copy(new ItemSprite());
			label.text(item.trueName());
			label.hardlight(0xCCCCCC);
		}
	} catch (Exception e) {
		EventCollector.logException(e);
	}
	add(sprite);
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:19,
代码来源:CatalogusListItem.java

示例12: createChildren

点赞 3

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {

    super.createChildren();

    icon = new ItemSprite();
    add(icon);

    emitter = new Emitter();
    add(emitter);

    topLeft = new BitmapText(PixelScene.font1x);
    topLeft.setScale(0.8f, 0.8f);
    add(topLeft);

    topRight = new BitmapText(PixelScene.font1x);
    topRight.setScale(0.8f, 0.8f);
    add(topRight);

    bottomRight = new BitmapText(PixelScene.font1x);
    bottomRight.setScale(0.8f, 0.8f);
    add(bottomRight);
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:24,
代码来源:ItemSlot.java

示例13: WndImp

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public WndImp( final Imp imp, final DwarfToken tokens ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( tokens.image(), null ) );
	titlebar.label( Utils.capitalize( tokens.name() ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnReward = new RedButton( TXT_REWARD ) {
		@Override
		protected void onClick() {
			takeReward( imp, tokens, Imp.Quest.reward );
		}
	};
	btnReward.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnReward );
	
	resize( WIDTH, (int)btnReward.bottom() );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:28,
代码来源:WndImp.java

示例14: createDescription

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private float createDescription( Item item, boolean forSale ) {
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( item.image(), item.glowing() ) );
	titlebar.label( forSale ? 
		Utils.format( TXT_SALE, item.toString(), price( item ) ) : 
		Utils.capitalize( item.toString() ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	if (item.levelKnown) {
		if (item.level() < 0) {
			titlebar.color( ItemSlot.DEGRADED );				
		} else if (item.level() > 0) {
			titlebar.color( item.isBroken() ? ItemSlot.WARNING : ItemSlot.UPGRADED );				
		}
	}
	
	BitmapTextMultiline info = PixelScene.createMultiline( item.info(), 6 );
	info.maxWidth = WIDTH;
	info.measure();
	info.x = titlebar.left();
	info.y = titlebar.bottom() + GAP;
	add( info );
	
	return info.y + info.height();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:28,
代码来源:WndTradeItem.java

示例15: createChildren

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
@Override
protected void createChildren() {
	sprite = new ItemSprite();
	add( sprite );
	
	label = PixelScene.createText( 8 );
	add( label );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:9,
代码来源:WndCatalogus.java

示例16: createCommonStuff

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private float createCommonStuff( TomeOfMastery tome, String text ) {
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( tome.image(), null ) );
	titlebar.label( tome.name() );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	HighlightedText hl = new HighlightedText( 6 );
	hl.text( text, WIDTH );
	hl.setPos( titlebar.left(), titlebar.bottom() + GAP );
	add( hl );
	
	return hl.bottom();
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:15,
代码来源:WndChooseWay.java

示例17: reset

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public void reset( Item item, float dstX, float dstY ) {
	view( item.image(), item.glowing() );
	
	active = 
	visible = 
		true;
	
	this.dstX = dstX - ItemSprite.SIZE / 2;
	this.dstY = dstY - ItemSprite.SIZE / 2;
	left = DURATION;
	
	x = this.dstX - DISTANCE;
	y = this.dstY - DISTANCE;
	alpha( 1 );
}
 

开发者ID:kurtyu,
项目名称:PixelDungeonTC,
代码行数:16,
代码来源:Toolbar.java

示例18: WndWandmaker

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public WndWandmaker( final Wandmaker wandmaker, final Item item ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( item.image(), null ) );
	titlebar.label( Utils.capitalize( item.name() ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline message = PixelScene.createMultiline( TXT_MESSAGE, 6 );
	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnBattle = new RedButton( TXT_BATTLE ) {
		@Override
		protected void onClick() {
			selectReward( wandmaker, item, Wandmaker.Quest.wand1 );
		}
	};
	btnBattle.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnBattle );
	
	RedButton btnNonBattle = new RedButton( TXT_NON_BATTLE ) {
		@Override
		protected void onClick() {
			selectReward( wandmaker, item, Wandmaker.Quest.wand2 );
		}
	};
	btnNonBattle.setRect( 0, btnBattle.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnNonBattle );
	
	resize( WIDTH, (int)btnNonBattle.bottom() );
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:37,
代码来源:WndWandmaker.java

示例19: WndSadGhost

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public WndSadGhost( final Ghost ghost, final Item item ) {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( item.image(), null ) );
	titlebar.label( Utils.capitalize( item.name() ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	BitmapTextMultiline message = PixelScene.createMultiline( item instanceof DriedRose ? TXT_ROSE : TXT_RAT, 6 );
	message.maxWidth = WIDTH;
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnWeapon = new RedButton( TXT_WEAPON ) {
		@Override
		protected void onClick() {
			selectReward( ghost, item, Ghost.Quest.weapon );
		}
	};
	btnWeapon.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnWeapon );
	
	RedButton btnArmor = new RedButton( TXT_ARMOR ) {
		@Override
		protected void onClick() {
			selectReward( ghost, item, Ghost.Quest.armor );
		}
	};
	btnArmor.setRect( 0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnArmor );
	
	resize( WIDTH, (int)btnArmor.bottom() );
}
 

开发者ID:skynet67,
项目名称:pixel-dungeon-rebirth,
代码行数:37,
代码来源:WndSadGhost.java

示例20: WndSadGhostNecro

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
public WndSadGhostNecro() {
	
	super();
	
	IconTitle titlebar = new IconTitle();
	titlebar.icon( new ItemSprite( new BlackSkull()) );
	titlebar.label( Utils.capitalize( Game.getVar(R.string.Necromancy_Title) ) );
	titlebar.setRect( 0, 0, WIDTH, 0 );
	add( titlebar );
	
	Text message = PixelScene.createMultiline( TXT_TEXT, GuiProperties.regularFontSize() );
	message.maxWidth(WIDTH);
	message.measure();
	message.y = titlebar.bottom() + GAP;
	add( message );
	
	RedButton btnWeapon = new RedButton( TXT_YES ) {
		@Override
		protected void onClick() {
			GLog.w( TXT_PERSUADED );
			persuade = true;
			hide();
		}
	};
	btnWeapon.setRect( 0, message.y + message.height() + GAP, WIDTH, BTN_HEIGHT );
	add( btnWeapon );
	
	RedButton btnArmor = new RedButton( TXT_NO ) {
		@Override
		protected void onClick() {
			persuade = false;
			hide();
		}
	};
	btnArmor.setRect( 0, btnWeapon.bottom() + GAP, WIDTH, BTN_HEIGHT );
	add( btnArmor );
	
	resize( WIDTH, (int)btnArmor.bottom() );
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:40,
代码来源:WndSadGhostNecro.java

示例21: fillFields

点赞 2

import com.watabou.pixeldungeon.sprites.ItemSprite; //导入依赖的package包/类
private void fillFields( Heap heap, int titleColor, String title, String info ) {
	GenericInfo.makeInfo(	this,
							new ItemSprite( heap ), 
							title, 
							titleColor, 
							info);
}
 

开发者ID:NYRDS,
项目名称:pixel-dungeon-remix,
代码行数:8,
代码来源:WndInfoItem.java


版权声明:本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系管理员进行删除。
喜欢 (0)