本文整理匯總了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 );
}
示例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);
}
}
}
示例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);
}
}