com.watabou.noosa.ColorBlock Java Examples

The following examples show how to use com.watabou.noosa.ColorBlock. 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: OptionSlider.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 6 votes vote down vote up
public OptionSlider(String title, String minTxt, String maxTxt, int minVal, int maxVal){
	super();

	//shouldn't function if this happens.
	if (minVal > maxVal){
		minVal = maxVal;
		active = false;
	}

	this.title.text(title);
	this.minTxt.text(minTxt);
	this.maxTxt.text(maxTxt);

	this.minVal = minVal;
	this.maxVal = maxVal;

	sliderTicks = new ColorBlock[(maxVal - minVal) + 1];
	for (int i = 0; i < sliderTicks.length; i++){
		add(sliderTicks[i] = new ColorBlock(1, 11, 0xFF222222));
	}
	add(sliderNode);
}
 
Example #2
Source File: OptionSlider.java    From shattered-pixel-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public OptionSlider(String title, String minTxt, String maxTxt, int minVal, int maxVal){
	super();

	//shouldn't function if this happens.
	if (minVal > maxVal){
		minVal = maxVal;
		active = false;
	}

	this.title.text(title);
	this.minTxt.text(minTxt);
	this.maxTxt.text(maxTxt);

	this.minVal = minVal;
	this.maxVal = maxVal;

	sliderTicks = new ColorBlock[(maxVal - minVal) + 1];
	for (int i = 0; i < sliderTicks.length; i++){
		add(sliderTicks[i] = new ColorBlock(1, 11, 0xFF222222));
	}
	add(sliderNode);
}
 
Example #3
Source File: SpellButton.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public SpellButton(WndHeroSpells wndHeroSpells, Char caster, Spell spell) {
    this.image = spell.image(caster);
    this.wndHeroSpells = wndHeroSpells;
    this.spell = spell;
    this.caster = caster;

    width = image.width + 6;
    height = image.height + 6;

    bg = new ColorBlock(width, height, 0xFF4A4D44);
    add(bg);

    add(image);

    cooldownMeter = new ColorBlock(width, height, 0x7f000000);
    add(cooldownMeter);
}
 
Example #4
Source File: WndInfoMob.java    From remixed-dungeon with GNU General Public License v3.0 6 votes vote down vote up
public MobTitle( Mob mob ) {

			hp = (float)mob.hp() / mob.ht();
			
			name = PixelScene.createText( Utils.capitalize( mob.getName() ), GuiProperties.titleFontSize());
			name.hardlight( TITLE_COLOR );
			add( name );
			
			image = mob.sprite();
			add( image );
			
			hpBg = new ColorBlock( 1, 1, COLOR_BG );
			add( hpBg );
			
			hpLvl = new ColorBlock( 1, 1, COLOR_LVL );
			add( hpLvl );
			
			buffs = new BuffIndicator( mob );
			add( buffs );
		}
 
Example #5
Source File: WndBag.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	bg = new ColorBlock( SLOT_WIDTH, SLOT_HEIGHT, NORMAL );
	add( bg );
	
	super.createChildren();
}
 
Example #6
Source File: WndBag.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {	
	bg = new ColorBlock( SLOT_SIZE, SLOT_SIZE, NORMAL );
	add( bg );
	
	super.createChildren();
}
 
Example #7
Source File: WndJournal.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
private void updateList(){
	Component content = list.content();
	
	float pos = 0;
	
	ColorBlock line = new ColorBlock( width(), 1, 0xFF222222);
	line.y = pos;
	content.add(line);
	
	RenderedTextBlock title = PixelScene.renderTextBlock(Document.ADVENTURERS_GUIDE.title(), 9);
	title.hardlight(TITLE_COLOR);
	title.maxWidth( (int)width() - 2 );
	title.setPos( (width() - title.width())/2f, pos + 1 + ((ITEM_HEIGHT) - title.height())/2f);
	PixelScene.align(title);
	content.add(title);
	
	pos += Math.max(ITEM_HEIGHT, title.height());
	
	for (String page : Document.ADVENTURERS_GUIDE.pages()){
		GuideItem item = new GuideItem( page );
		
		item.setRect( 0, pos, width(), ITEM_HEIGHT );
		content.add( item );
		
		pos += item.height();
		pages.add(item);
	}
	
	content.setSize( width(), pos );
	list.setSize( list.width(), list.height() );
}
 
Example #8
Source File: ScrollPane.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	controller = new PointerController();
	add( controller );

	thumb = new ColorBlock( 1, 1, THUMB_COLOR );
	thumb.am = THUMB_ALPHA;
	add( thumb );
}
 
Example #9
Source File: HealthBar.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	Bg = new ColorBlock( 1, 1, COLOR_BG );
	add( Bg );

	Shld = new ColorBlock( 1, 1, COLOR_SHLD );
	add( Shld );
	
	Hp = new ColorBlock( 1, 1, COLOR_HP );
	add( Hp );
	
	height = HEIGHT;
}
 
Example #10
Source File: ItemButton.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {	
    bg = new ColorBlock( WndBag.SLOT_SIZE, WndBag.SLOT_SIZE, NORMAL );
    add( bg );
    
    super.createChildren();
}
 
Example #11
Source File: WndRanking.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {	
	
	bg = new ColorBlock( HEIGHT, HEIGHT, 0xFF4A4D44 );
	add( bg );
	
	slot = new ItemSlot();
	add( slot );
	
	name = PixelScene.createText( "?", GuiProperties.smallFontSize());
	add( name );
	
	super.createChildren();
}
 
Example #12
Source File: QuickslotTool.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
QuickslotTool() {
    super(-1, Chrome.Type.QUICKSLOT);

    slot = new QuickSlot();
    add(slot);

    cooldownMeter = new ColorBlock(width, height, 0x7f000000);
    add(cooldownMeter);
}
 
Example #13
Source File: WndJournal.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	label = PixelScene.renderTextBlock( 7 );
	add( label );
	
	icon = new Image();
	add( icon );
	
	depth = new BitmapText( PixelScene.pixelFont);
	add( depth );
	
	line = new ColorBlock( 1, 1, 0xFF222222);
	add(line);
	
}
 
Example #14
Source File: WndDocument.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	label = PixelScene.renderTextBlock( 7 );
	add( label );
	
	icon = new Image();
	add( icon );
	
	depth = new BitmapText( PixelScene.pixelFont);
	add( depth );
	
	line = new ColorBlock( 1, 1, 0xFF222222);
	add(line);
	
}
 
Example #15
Source File: WndRanking.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public ItemsTab() {
	super();
	
	Belongings stuff = Dungeon.hero.belongings;
	if (stuff.weapon != null) {
		addItem( stuff.weapon );
	}
	if (stuff.armor != null) {
		addItem( stuff.armor );
	}
	if (stuff.misc1 != null) {
		addItem( stuff.misc1);
	}
	if (stuff.misc2 != null) {
		addItem( stuff.misc2);
	}

	pos = 0;
	for (int i = 0; i < 4; i++){
		if (Dungeon.quickslot.getItem(i) != null){
			QuickSlotButton slot = new QuickSlotButton(Dungeon.quickslot.getItem(i));

			slot.setRect( pos, 116, 28, 28 );

			add(slot);

		} else {
			ColorBlock bg = new ColorBlock( 28, 28, 0x9953564D );
			bg.x = pos;
			bg.y = 116;
			add(bg);
		}
		pos += 29;
	}
}
 
Example #16
Source File: WndRanking.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	
	bg = new ColorBlock( HEIGHT, HEIGHT, 0x9953564D );
	add( bg );
	
	slot = new ItemSlot();
	add( slot );
	
	name = PixelScene.renderTextBlock( 7 );
	add( name );
	
	super.createChildren();
}
 
Example #17
Source File: WndRanking.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	bg = new ColorBlock( HEIGHT, HEIGHT, 0x9953564D );
	add( bg );

	super.createChildren();
}
 
Example #18
Source File: WndJournal.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	label = PixelScene.renderTextBlock( 7 );
	add( label );
	
	icon = new Image();
	add( icon );
	
	depth = new BitmapText( PixelScene.pixelFont);
	add( depth );
	
	line = new ColorBlock( 1, 1, 0xFF222222);
	add(line);
	
}
 
Example #19
Source File: WndJournal.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
private void updateList(){
	Component content = list.content();
	
	float pos = 0;
	
	ColorBlock line = new ColorBlock( width(), 1, 0xFF222222);
	line.y = pos;
	content.add(line);
	
	RenderedTextBlock title = PixelScene.renderTextBlock(Document.ADVENTURERS_GUIDE.title(), 9);
	title.hardlight(TITLE_COLOR);
	title.maxWidth( (int)width() - 2 );
	title.setPos( (width() - title.width())/2f, pos + 1 + ((ITEM_HEIGHT) - title.height())/2f);
	PixelScene.align(title);
	content.add(title);
	
	pos += Math.max(ITEM_HEIGHT, title.height());
	
	for (String page : Document.ADVENTURERS_GUIDE.pages()){
		GuideItem item = new GuideItem( page );
		
		item.setRect( 0, pos, width(), ITEM_HEIGHT );
		content.add( item );
		
		pos += item.height();
		pages.add(item);
	}
	
	content.setSize( width(), pos );
	list.setSize( list.width(), list.height() );
}
 
Example #20
Source File: ScrollPane.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	controller = new TouchController();
	add( controller );

	thumb = new ColorBlock( 1, 1, THUMB_COLOR );
	thumb.am = THUMB_ALPHA;
	add( thumb );
}
 
Example #21
Source File: HealthBar.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	Bg = new ColorBlock( 1, 1, COLOR_BG );
	add( Bg );

	Shld = new ColorBlock( 1, 1, COLOR_SHLD );
	add( Shld );
	
	Hp = new ColorBlock( 1, 1, COLOR_HP );
	add( Hp );
	
	height = HEIGHT;
}
 
Example #22
Source File: WndRanking.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {	
	
	bg = new ColorBlock( SIZE, SIZE, 0xFF4A4D44 );
	add( bg );
	
	slot = new ItemSlot();
	add( slot );
	
	super.createChildren();
}
 
Example #23
Source File: WndRanking.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {	
	
	bg = new ColorBlock( SIZE, SIZE, 0xFF4A4D44 );
	add( bg );
	
	slot = new ItemSlot();
	add( slot );
	
	super.createChildren();
}
 
Example #24
Source File: ScrollPane.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	controller = new TouchController();
	add( controller );

       indicator = new ColorBlock( 1, 1, INDICATOR_COLOR );
       indicator.am = INDICATOR_ALPHA;
       add(indicator);
}
 
Example #25
Source File: HealthBar.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	hpBg = new ColorBlock( 1, 1, COLOR_BG );
	add( hpBg );
	
	hpLvl = new ColorBlock( 1, 1, COLOR_LVL );
	add( hpLvl );
	
	height = HEIGHT;
}
 
Example #26
Source File: WndBag.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	bg = new ColorBlock( SLOT_SIZE, SLOT_SIZE, NORMAL );
	add( bg );
	
	super.createChildren();
}
 
Example #27
Source File: WndRanking.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	
	bg = new ColorBlock( HEIGHT, HEIGHT, 0xFF4A4D44 );
	add( bg );
	
	slot = new ItemSlot();
	add( slot );
	
	name = PixelScene.createText( "?", 7 );
	add( name );
	
	super.createChildren();
}
 
Example #28
Source File: WndRanking.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	bg = new ColorBlock( HEIGHT, HEIGHT, 0xFF4A4D44 );
	add( bg );

	super.createChildren();
}
 
Example #29
Source File: HealthBar.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {
	hpBg = new ColorBlock( 1, 1, COLOR_BG );
	add( hpBg );
	
	hpLvl = new ColorBlock( 1, 1, COLOR_LVL );
	add( hpLvl );
	
	height = HEIGHT;
}
 
Example #30
Source File: WndBag.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
@Override
protected void createChildren() {	
	bg = new ColorBlock( SLOT_SIZE, SLOT_SIZE, NORMAL );
	add( bg );
	
	super.createChildren();
}