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


Java Painter.fillEllipse方法代码示例

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


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

示例1: paint

import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入方法依赖的package包/类
@Override
public void paint(Level level) {
	Painter.fill( level, this, Terrain.WALL );

	Painter.fillEllipse( level, this, 1 , Terrain.EMPTY );

	for (Door door : connected.values()) {
		door.set( Door.Type.REGULAR );
		if (door.x == left || door.x == right){
			Painter.drawInside(level, this, door, width()/2, Terrain.EMPTY);
		} else {
			Painter.drawInside(level, this, door, height()/2, Terrain.EMPTY);
		}
	}

	Painter.fillEllipse( level, this, 3 , Terrain.CHASM );
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:18,代码来源:CirclePitRoom.java

示例2: paint

import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入方法依赖的package包/类
public void paint( Level level ) {
	
	Painter.fill( level, this, Terrain.WALL );
	Painter.fill( level, this, 1, Terrain.BOOKSHELF );
	
	Painter.fillEllipse(level, this, 2, Terrain.EMPTY_SP);
	
	Door entrance = entrance();
	if (entrance.x == left || entrance.x == right){
		Painter.drawInside(level, this, entrance, (width() - 3) / 2, Terrain.EMPTY_SP);
	} else {
		Painter.drawInside(level, this, entrance, (height() - 3) / 2, Terrain.EMPTY_SP);
	}
	entrance.set( Door.Type.HIDDEN );
	
	int n = Random.IntRange( 2, 3 );
	HashMap<Class<? extends Scroll>, Float> chances = new HashMap<>(scrollChances);
	for (int i=0; i < n; i++) {
		int pos;
		do {
			pos = level.pointToCell(random());
		} while (level.map[pos] != Terrain.EMPTY_SP || level.heaps.get( pos ) != null);
		
		try{
			Class<?extends Scroll> scrollCls = Random.chances(chances);
			chances.put(scrollCls, 0f);
			level.drop( scrollCls.newInstance(), pos );
		} catch (Exception e){
			ShatteredPixelDungeon.reportException(e);
		}
		
	}
}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:34,代码来源:SecretLibraryRoom.java

示例3: paint

import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; //导入方法依赖的package包/类
@Override
public void paint(Level level) {

	int minDim = Math.min(width(), height());

	Painter.fill( level, this, Terrain.WALL );

	if (minDim >= 9) {
		Painter.fillEllipse(level, this, 2, Terrain.EMPTY);
	} else {
		Painter.fill(level, this, 2, Terrain.EMPTY);
	}

	for (Door door : connected.values()) {
		door.set( Door.Type.REGULAR );
		if (door.x == left || door.x == right){
			Painter.drawInside(level, this, door, (width() - 3) / 2, Terrain.EMPTY);
		} else {
			Painter.drawInside(level, this, door, (height() - 3) / 2, Terrain.EMPTY);
		}
	}

	boolean oddWidth = width() % 2 == 1;
	boolean oddHeight = height() % 2 == 1;

	if (minDim >= 12){

		Painter.fillEllipse(level, this, 5, Terrain.STATUE);
		Painter.fillEllipse(level, this, 6, Terrain.WALL);

	} else {

		Painter.fill(level,
				left + width()/2 + (oddWidth ? 0 : -1),
				top + height()/2 + (oddHeight ? 0 : -1),
				oddWidth ? 1 : 2,
				oddHeight ? 1 : 2,
				Terrain.STATUE);

	}

}
 
开发者ID:00-Evan,项目名称:shattered-pixel-dungeon,代码行数:43,代码来源:SkullsRoom.java


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