本文整理汇总了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);
}
}