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


Java BitmapText.hardlight方法代码示例

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


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

示例1: placeTitle

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
protected void placeTitle( Bag bag, int width ){
	
	RenderedText txtTitle = PixelScene.renderText(
			title != null ? Messages.titleCase(title) : Messages.titleCase( bag.name() ), 9 );
	txtTitle.hardlight( TITLE_COLOR );
	txtTitle.x = 1;
	txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.baseLine()) / 2f - 1;
	PixelScene.align(txtTitle);
	add( txtTitle );
	
	ItemSprite gold = new ItemSprite(ItemSpriteSheet.GOLD, null);
	gold.x = width - gold.width() - 1;
	gold.y = (TITLE_HEIGHT - gold.height())/2f - 1;
	PixelScene.align(gold);
	add(gold);
	
	BitmapText amt = new BitmapText( Integer.toString(Dungeon.gold), PixelScene.pixelFont );
	amt.hardlight(TITLE_COLOR);
	amt.measure();
	amt.x = width - gold.width() - amt.width() - 2;
	amt.y = (TITLE_HEIGHT - amt.baseLine())/2f - 1;
	PixelScene.align(amt);
	add(amt);
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:25,代码来源:WndBag.java

示例2: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
protected void createChildren() {
	tf = new BitmapText(PixelScene.font1x);
	tf.hardlight(0xFFFF00);
	add(tf);

	visible = false;
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:9,代码来源:GoldIndicator.java

示例3: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
protected void createChildren() {
	tf = new BitmapText( PixelScene.pixelFont);
	tf.hardlight( 0xFFFF00 );
	add( tf );
	
	visible = false;
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:9,代码来源:GoldIndicator.java

示例4: WndChallenges

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndChallenges( int checked, boolean editable ) {
	
	super();
	
	this.editable = editable;
	
	BitmapText title = PixelScene.createText( TITLE, 9 );
	title.hardlight( TITLE_COLOR );
	title.measure();
	title.x = PixelScene.align( camera, (WIDTH - title.width()) / 2 );
	title.y = PixelScene.align( camera, (TTL_HEIGHT - title.height()) / 2 );
	add( title );

	boxes = new ArrayList<CheckBox>();
	
	float pos = TTL_HEIGHT;
	for (int i=0; i < Challenges.NAMES.length; i++) {
		
		CheckBox cb = new CheckBox( Challenges.NAMES[i] );
		cb.checked( (checked & Challenges.MASKS[i]) != 0 );
		cb.active = editable;
		
		if (i > 0) {
			pos += GAP;
		}
		cb.setRect( 0, pos, WIDTH, BTN_HEIGHT );
		pos = cb.bottom();
		
		add( cb );
		boxes.add( cb );
	}

	resize( WIDTH, (int)pos );
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:35,代码来源:WndChallenges.java

示例5: WndChallenges

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndChallenges(int checked, boolean editable) {
	
	super();
	
	this.editable = editable;
	
	BitmapText title = PixelScene.createText( TITLE, 9 );
	title.hardlight( TITLE_COLOR );
	title.measure();
	title.x = PixelScene.align( camera, (WIDTH - title.width()) / 2 );
	title.y = PixelScene.align( camera, (TTL_HEIGHT - title.height()) / 2 );
	add( title );

	boxes = new ArrayList<CheckBox>();
	
	float pos = TTL_HEIGHT;
	for (int i=0; i < Challenges.NAMES.length; i++) {
		
		CheckBox cb = new CheckBox( Challenges.NAMES[i] );
		cb.checked( (checked & Challenges.MASKS[i]) != 0 );
		cb.active = editable;
		
		if (i > 0) {
			pos += GAP;
		}
		cb.setRect( 0, pos, WIDTH, BTN_HEIGHT );
		pos = cb.bottom();
		
		add( cb );
		boxes.add( cb );
	}

	resize( WIDTH, (int)pos );
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:35,代码来源:WndChallenges.java

示例6: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
protected void createChildren() {
	tf = new BitmapText( PixelScene.font1x );
	tf.hardlight( 0xFFFF00 );
	add( tf );
	
	visible = false;
}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:9,代码来源:GoldIndicator.java

示例7: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
protected void createChildren() {
    tf = new BitmapText(PixelScene.font1x);
    tf.hardlight(0xFFFF00);
    add(tf);

    visible = false;
}
 
开发者ID:skynet67,项目名称:pixel-dungeon-rebirth,代码行数:9,代码来源:GoldIndicator.java

示例8: WndChallenges

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndChallenges( int checked, boolean editable ) {

		super();

		this.editable = editable;

		BitmapText title = PixelScene.createText( TITLE, 9 );
		title.hardlight( TITLE_COLOR );
		title.measure();
		title.x = PixelScene.align( camera, (WIDTH - title.width()) / 2 );
		title.y = PixelScene.align( camera, (TTL_HEIGHT - title.height()) / 2 );
		add( title );

		boxes = new ArrayList<CheckBox>();

		float pos = TTL_HEIGHT;
		for (int i=0; i < Challenges.NAMES.length; i++) {

			CheckBox cb = new CheckBox( Challenges.NAMES[i] );
			cb.checked( (checked & Challenges.MASKS[i]) != 0 );
			cb.active = editable;

			if (i > 0) {
				pos += GAP;
			}
			cb.setRect( 0, pos, WIDTH, BTN_HEIGHT );
			pos = cb.bottom();

			add( cb );
			boxes.add( cb );
		}

		resize( WIDTH, (int)pos );
	}
 
开发者ID:Sarius997,项目名称:Multiplayer-PD,代码行数:35,代码来源:WndChallenges.java

示例9: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
protected void createChildren() {
	tf = new BitmapText( PixelScene.font1x );
	tf.hardlight( 0xFFFF00 );
	add( tf );
	
	setVisible(false);
}
 
开发者ID:NYRDS,项目名称:pixel-dungeon-remix,代码行数:9,代码来源:GoldIndicator.java

示例10: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
protected void createChildren() {

	bg = new NinePatch(Assets.STATUS, 80, 0, 30 + 18, 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());
		}
	});

	btnMenu = new MenuButton();
	add(btnMenu);

	avatar = HeroSprite.avatar(Dungeon.hero.heroClass, lastTier);
	add(avatar);

	compass = new Compass(Dungeon.level.exit);
	add(compass);

	shield = new Image(Assets.SHLD_BAR);
	//	add(shield);

	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.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);

	buffs = new BuffIndicator(Dungeon.hero);
	add(buffs);
}
 
开发者ID:G2159687,项目名称:ESPD,代码行数:60,代码来源:StatusPane.java

示例11: createChildren

import com.watabou.noosa.BitmapText; //导入方法依赖的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( 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());
}
 
开发者ID:mango-tree,项目名称:UNIST-pixel-dungeon,代码行数:63,代码来源:StatusPane.java

示例12: create

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
public void create() {
	
	super.create();
	
	Music.INSTANCE.play( Assets.THEME, true );
	Music.INSTANCE.volume( 1f );
	
	uiCamera.visible = false;
	
	int w = Camera.main.width;
	int h = Camera.main.height;
	
	Archs archs = new Archs();
	archs.setSize( w, h );
	add( archs );
	
	int pw = (int)Math.min( w, (PixelDungeon.landscape() ? MIN_WIDTH_L : MIN_WIDTH_P) * 3 ) - 16;
	int ph = (int)Math.min( h, (PixelDungeon.landscape() ? MIN_HEIGHT_L : MIN_HEIGHT_P) * 3 ) - 32;
	
	float size = (float)Math.sqrt( pw * ph / 27f );
	int nCols = (int)Math.ceil( pw / size );
	int nRows = (int)Math.ceil( ph / size );
	size = Math.min( pw / nCols, ph / nRows );
	
	float left = (w - size * nCols) / 2;
	float top = (h - size * nRows) / 2;
	
	BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
	title.hardlight( Window.TITLE_COLOR );
	title.measure();
	title.x = align( (w - title.width()) / 2 );
	title.y = align( (top - title.baseLine()) / 2 );
	add( title );
	
	Badges.loadGlobal();
	
	List<Badges.Badge> badges = Badges.filtered( true );
	for (int i=0; i < nRows; i++) {
		for (int j=0; j < nCols; j++) {
			int index = i * nCols + j;
			Badges.Badge b = index < badges.size() ? badges.get( index ) : null;
			BadgeButton button = new BadgeButton( b );
			button.setPos(
				left + j * size + (size - button.width()) / 2,
				top + i * size + (size - button.height()) / 2);
			add( button );
		}
	}
	
	ExitButton btnExit = new ExitButton();
	btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
	add( btnExit );
	
	fadeIn();
	
	Badges.loadingListener = new Callback() {
		@Override
		public void call() {
			if (Game.scene() == BadgesScene.this) {
				PixelDungeon.switchNoFade( BadgesScene.class );
			}
		}
	};
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:66,代码来源:BadgesScene.java

示例13: WndBag

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public WndBag( Bag bag, Listener listener, Mode mode, String title ) {
	
	super();
	
	this.listener = listener;
	this.mode = mode;
	this.title = title;
	
	lastMode = mode;
	lastBag = bag;
	
	nCols = PixelDungeon.landscape() ? COLS_L : COLS_P;
	nRows = (Belongings.BACKPACK_SIZE + 4 + 1) / nCols + ((Belongings.BACKPACK_SIZE + 4 + 1) % nCols > 0 ? 1 : 0);
	
	int slotsWidth = SLOT_SIZE * nCols + SLOT_MARGIN * (nCols - 1);
	int slotsHeight = SLOT_SIZE * nRows + SLOT_MARGIN * (nRows - 1);
	
	BitmapText txtTitle = PixelScene.createText( title != null ? title : Utils.capitalize( bag.name() ), 9 );
	txtTitle.hardlight( TITLE_COLOR );
	txtTitle.measure();
	txtTitle.x = (int)(slotsWidth - txtTitle.width()) / 2;
	txtTitle.y = (int)(TITLE_HEIGHT - txtTitle.height()) / 2;
	add( txtTitle );
	
	placeItems( bag );
	
	resize( slotsWidth, slotsHeight + TITLE_HEIGHT );
	
	Belongings stuff = Dungeon.hero.belongings;
	Bag[] bags = {
		stuff.backpack, 
		stuff.getItem( SeedPouch.class ), 
		stuff.getItem( ScrollHolder.class ),
		stuff.getItem( WandHolster.class ),
		stuff.getItem( Keyring.class )};
	
	for (Bag b : bags) {
		if (b != null) {
			BagTab tab = new BagTab( b );
			tab.setSize( TAB_WIDTH, tabHeight() );
			add( tab );
			
			tab.select( b == bag );
		}
	}
}
 
开发者ID:kurtyu,项目名称:PixelDungeonTC,代码行数:47,代码来源:WndBag.java

示例14: StatsTab

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
public StatsTab() {
	
	Hero hero = Dungeon.hero; 

	BitmapText title = PixelScene.createText( 
		Utils.format( TXT_TITLE, hero.lvl, hero.className() ).toUpperCase( Locale.ENGLISH ), 9 );
	title.hardlight( TITLE_COLOR );
	title.measure();
	add( title );
	
	RedButton btnCatalogus = new RedButton( TXT_CATALOGUS ) {
		@Override
		protected void onClick() {
			hide();
			GameScene.show( new WndCatalogus() );
		}
	};
	btnCatalogus.setRect( 0, title.y + 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:kurtyu,项目名称:PixelDungeonTC,代码行数:46,代码来源:WndHero.java

示例15: create

import com.watabou.noosa.BitmapText; //导入方法依赖的package包/类
@Override
	public void create() {
		
		super.create();
		
		Music.INSTANCE.play( Assets.THEME, true );
		Music.INSTANCE.volume( 1f );
		
		uiCamera.visible = false;
		
		int w = Camera.main.width;
		int h = Camera.main.height;
		
		Archs archs = new Archs();
		archs.setSize( w, h );
		add( archs );
		
		int pw = Math.min( MAX_PANE_WIDTH, w - 6 );
		int ph = h - 30;
		
		NinePatch panel = Chrome.get( Chrome.Type.WINDOW );
		panel.size( pw, ph );
		panel.x = (w - pw) / 2;
		panel.y = (h - ph) / 2;
		add( panel );
		
		BitmapText title = PixelScene.createText( TXT_TITLE, 9 );
		title.hardlight( Window.TITLE_COLOR );
		title.measure();
		title.x = align( (w - title.width()) / 2 );
		title.y = align( (panel.y - title.baseLine()) / 2 );
		add( title );

		ScrollPane list = new BadgesList( true );
		add( list );

		list.setRect( 
			panel.x + panel.marginLeft(), 
			panel.y + panel.marginTop(), 
			panel.innerWidth(), 
			panel.innerHeight() );
		
		ExitButton btnExit = new ExitButton();
		btnExit.setPos( Camera.main.width - btnExit.width(), 0 );
		add( btnExit );
		
		fadeIn();
		
//		Badges.loadingListener = new Callback() {
//			@Override
//			public void call() {
//				if (Game.scene() == BadgesScene.this) {
//					YetAnotherPixelDungeon.switchNoFade(BadgesScene.class);
//				}
//			}
//		};
	}
 
开发者ID:ConsideredHamster,项目名称:YetAnotherPixelDungeon,代码行数:58,代码来源:BadgesScene.java


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