Java Code Examples for com.watabou.noosa.Group#add()

The following examples show how to use com.watabou.noosa.Group#add() . 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: CavesLevel.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void addCavesVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Vein( i ) );
		}
	}
}
 
Example 2
Source File: CityLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public static void addCityVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Smoke( i ) );
		}
	}
}
 
Example 3
Source File: SewerLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public static void addSewerVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Sink( i ) );
		}
	}
}
 
Example 4
Source File: PrisonLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public static void addPrisonVisuals(Level level, Group group){
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Torch( i ) );
		}
	}
}
 
Example 5
Source File: HallsLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public static void addHallsVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WATER) {
			group.add( new Stream( i ) );
		}
	}
}
 
Example 6
Source File: WndRanking.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
private float statSlot( Group parent, String label, String value, float pos ) {
	
	RenderedTextBlock txt = PixelScene.renderTextBlock( label, 7 );
	txt.setPos(0, pos);
	parent.add( txt );
	
	txt = PixelScene.renderTextBlock( value, 7 );
	txt.setPos(WIDTH * 0.7f, pos);
	PixelScene.align(txt);
	parent.add( txt );
	
	return pos + GAP + txt.height();
}
 
Example 7
Source File: WndRanking.java    From remixed-dungeon with GNU General Public License v3.0 5 votes vote down vote up
private float statSlot( Group parent, String label, String value, float pos ) {
	
	Text txt = PixelScene.createText( label, GuiProperties.regularFontSize() );
	txt.y = pos;
	parent.add( txt );
	
	txt = PixelScene.createText( value, GuiProperties.regularFontSize() );
	txt.x = PixelScene.align( WIDTH * 0.65f );
	txt.y = pos;
	parent.add( txt );
	
	return pos + GAP + txt.baseLine();
}
 
Example 8
Source File: Flare.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public Flare show( Group parent, PointF pos, float duration ) {
	point( pos );
	parent.add( this );

	lifespan = this.duration = duration;
	if (lifespan > 0) scale.set( 0 );

	return this;
}
 
Example 9
Source File: CircleArc.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public CircleArc show(Group parent, PointF pos, float duration ) {
	point( pos );
	parent.add( this );
	
	lifespan = this.duration = duration;
	
	return this;
}
 
Example 10
Source File: WndRanking.java    From YetAnotherPixelDungeon with GNU General Public License v3.0 5 votes vote down vote up
private float statSlot( Group parent, String label, String value, float pos ) {
	
	BitmapText txt = PixelScene.createText( label, 7 );
	txt.y = pos;
	parent.add( txt );
	
	txt = PixelScene.createText( value, 6 );
	txt.measure();
	txt.x = PixelScene.align( WIDTH * 0.65f );
	txt.y = pos;
	parent.add( txt );
	
	return pos + GAP + txt.baseLine();
}
 
Example 11
Source File: CircleArc.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public CircleArc show(Group parent, PointF pos, float duration ) {
	point( pos );
	parent.add( this );
	
	lifespan = this.duration = duration;
	
	return this;
}
 
Example 12
Source File: SewerLevel.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void addSewerVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Sink( i ) );
		}
	}
}
 
Example 13
Source File: PrisonLevel.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void addPrisonVisuals(Level level, Group group){
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Torch( i ) );
		}
	}
}
 
Example 14
Source File: HallsLevel.java    From shattered-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public static void addHallsVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WATER) {
			group.add( new Stream( i ) );
		}
	}
}
 
Example 15
Source File: CavesLevel.java    From shattered-pixel-dungeon-gdx with GNU General Public License v3.0 5 votes vote down vote up
public static void addCavesVisuals( Level level, Group group ) {
	for (int i=0; i < level.length(); i++) {
		if (level.map[i] == Terrain.WALL_DECO) {
			group.add( new Vein( i ) );
		}
	}
}
 
Example 16
Source File: Flare.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
public Flare show( Group parent, PointF pos, float duration ) {
	point( pos );
	parent.add( this );
	
	lifespan = this.duration = duration;
	
	return this;
}
 
Example 17
Source File: WndRanking.java    From pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
private float statSlot( Group parent, String label, String value, float pos ) {
	
	BitmapText txt = PixelScene.createText( label, 7 );
	txt.y = pos;
	parent.add( txt );
	
	txt = PixelScene.createText( value, 7 );
	txt.measure();
	txt.x = PixelScene.align( WIDTH * 0.65f );
	txt.y = pos;
	parent.add( txt );
	
	return pos + GAP + txt.baseLine();
}
 
Example 18
Source File: WndRanking.java    From unleashed-pixel-dungeon with GNU General Public License v3.0 5 votes vote down vote up
private float statSlot( Group parent, String label, String value, float pos ) {
	
	BitmapText txt = PixelScene.createText( label, 7 );
	txt.y = pos;
	parent.add( txt );
	
	txt = PixelScene.createText( value, 7 );
	txt.measure();
	txt.x = PixelScene.align( WIDTH * 0.65f );
	txt.y = pos;
	parent.add( txt );
	
	return pos + GAP + txt.baseLine();
}
 
Example 19
Source File: ZapEffect.java    From remixed-dungeon with GNU General Public License v3.0 4 votes vote down vote up
static public void zap(Group parent, int from, int to, String zapEffect)
{
    Level level = Dungeon.level;
    if (zapEffect != null && level.cellValid(from) && level.cellValid(to)) {
        
        if (!Dungeon.visible[from] && !Dungeon.visible[to]){
            return;
        }

        if(EffectsFactory.isValidEffectName(zapEffect)) {
            attachMissileTeenier(GameScene.clipEffect(from, 1,zapEffect),from,to);
            return;
        }

        if(ItemFactory.isValidItemClass(zapEffect)) {
            ((MissileSprite)parent.recycle( MissileSprite.class )).
                    reset(from, to, ItemFactory.itemByName(zapEffect), Util.nullCallback);
            return;
        }

        if(zapEffect.equals("Lightning")) {
            parent.add(new Lightning(from, to, Util.nullCallback));
            return;
        }

        if(zapEffect.equals("DeathRay")) {
            parent.add(new DeathRay(from, to));
            return;
        }

        if(zapEffect.equals("Shadow")) {
            MagicMissile.shadow(parent, from, to, Util.nullCallback);
            Sample.INSTANCE.play(Assets.SND_ZAP);
            return;
        }

        if(zapEffect.equals("Fire")) {
            MagicMissile.fire(parent, from, to, Util.nullCallback);
            return;
        }

        if(zapEffect.equals("Ice")) {
            MagicMissile.ice(parent, from, to, Util.nullCallback);
            return;
        }

        if(zapEffect.equals("Telekinesis")) {
            MagicMissile.force(parent, from, to, Util.nullCallback);
            return;
        }
    }
}
 
Example 20
Source File: AboutScene.java    From shattered-pixel-dungeon with GNU General Public License v3.0 4 votes vote down vote up
private void addLine( float y, Group content ){
	ColorBlock line = new ColorBlock(Camera.main.width, 1, 0xFF333333);
	line.y = y;
	content.add(line);
}