當前位置: 首頁>>代碼示例>>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;未經允許,請勿轉載。