本文整理汇总了Java中com.badlogic.gdx.graphics.glutils.ShapeRenderer.circle方法的典型用法代码示例。如果您正苦于以下问题:Java ShapeRenderer.circle方法的具体用法?Java ShapeRenderer.circle怎么用?Java ShapeRenderer.circle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.glutils.ShapeRenderer
的用法示例。
在下文中一共展示了ShapeRenderer.circle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: drawShape
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void drawShape(GameTime time, CameraWrapper camera, ShapeRenderer shapeRenderer, Color color) {
shapeRenderer.setColor(color);
shapeRenderer.set(ShapeRenderer.ShapeType.Line);
shapeRenderer.circle(getCenterX(), getCenterY(), 3);
}
示例2: drawShape
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void drawShape(GameTime time, CameraWrapper camera, ShapeRenderer shapeRenderer, Color color) {
shapeRenderer.setColor(color);
shapeRenderer.set(ShapeRenderer.ShapeType.Line);
shapeRenderer.circle(getCenterX(), getCenterY(), this.radius);
}
示例3: debugRender
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
public void debugRender(ShapeRenderer shapeRenderer, SpriteBatch spriteBatch, BitmapFont font, Camera camera) {
// box
shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
shapeRenderer.setColor(Color.BLACK);
for (float x = 0; x < mapWidth; x++) {
for (float y = 0; y < mapHeight; y++) {
shapeRenderer.box(x, y, 0, 1f, 1f, 0f);
}
}
shapeRenderer.end();
// fps
spriteBatch.begin();
font.setColor(Color.RED);
font.draw(spriteBatch, Gdx.graphics.getFramesPerSecond() + "", 0, 15);
font.setColor(Color.WHITE);
// costs + cords
for (int x = 0; x < mapWidth; x++) {
for (int y = 0; y < mapHeight; y++) {
Vector2 point = new Vector2(x, y + 1);
CoordinateUtil.worldToTouch(point, camera);
font.draw(spriteBatch, cost[x][y] + "", point.x, point.y);
// point = new Vector2(x, y);
// CoordinateUtil.worldToTouch(point, camera);
// font.draw(spriteBatch, x + "", point.x, point.y);
//
// point = new Vector2(x + 1, y);
// CoordinateUtil.worldToTouch(point, camera);
// font.draw(spriteBatch, y + "", point.x, point.y);
}
}
spriteBatch.end();
// vector
shapeRenderer.begin(ShapeRenderer.ShapeType.Line);
shapeRenderer.setColor(Color.RED);
for (int x = 0; x < mapWidth; x++) {
for (int y = 0; y < mapHeight; y++) {
Vector2 dir = direction[x][y];
dir = dir.cpy().scl(0.5f);
shapeRenderer.circle(x + 0.5f, y + 0.5f, 0.1f, 20);
shapeRenderer.line(x + 0.5f, y + 0.5f, x + dir.x + 0.5f, y + dir.y + 0.5f);
}
}
shapeRenderer.end();
}
示例4: drawOutline
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void drawOutline(ShapeRenderer sr) {
sr.set(ShapeRenderer.ShapeType.Line);
sr.circle(x, y, size);
}