Java Code Examples for com.watabou.noosa.Image#alpha()

The following examples show how to use com.watabou.noosa.Image#alpha() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: BossHealthBar.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	bar = new Image(asset, 0, 0, 64, 16);
	add(bar);

	width = bar.width;
	height = bar.height;

	rawShielding = new Image(asset, 15, 25, 47, 4);
	rawShielding.alpha(0.5f);
	add(rawShielding);

	shieldedHP = new Image(asset, 15, 25, 47, 4);
	add(shieldedHP);

	hp = new Image(asset, 15, 19, 47, 4);
	add(hp);

	skull = new Image(asset, 5, 18, 6, 6);
	add(skull);

	blood = new Emitter();
	blood.pos(skull);
	blood.pour(BloodParticle.FACTORY, 0.3f);
	blood.autoKill = false;
	blood.on = false;
	add( blood );
}
 
Example 2
Source File: StatusPane.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
@Override
protected void createChildren() {

	bg = new NinePatch( Assets.Interfaces.STATUS, 0, 0, 128, 36, 85, 0, 45, 0 );
	add( bg );

	add( new Button(){
		@Override
		protected void onClick () {
			Camera.main.panTo( Dungeon.hero.sprite.center(), 5f );
			GameScene.show( new WndHero() );
		}
		
		@Override
		public GameAction keyAction() {
			return SPDAction.HERO_INFO;
		}
	}.setRect( 0, 1, 30, 30 ));

	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.Interfaces.SHLD_BAR );
	rawShielding.alpha(0.5f);
	add(rawShielding);

	shieldedHP = new Image( Assets.Interfaces.SHLD_BAR );
	add(shieldedHP);

	hp = new Image( Assets.Interfaces.HP_BAR );
	add( hp );

	exp = new Image( Assets.Interfaces.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());
	
	version = new BitmapText( "v" + Game.version, PixelScene.pixelFont);
	version.alpha( 0.5f );
	add(version);
}
 
Example 3
Source File: StatusPane.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 4 votes vote down vote up
@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;
			Camera.main.panTo( sprite.center(), 5f );
			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());
	
	version = new BitmapText( "v" + Game.version, PixelScene.pixelFont);
	version.alpha( 0.5f );
	add(version);
}