當前位置: 首頁>>代碼示例>>Java>>正文


Java ShapeRenderer.circle方法代碼示例

本文整理匯總了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);
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:7,代碼來源:CPoint.java

示例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);
}
 
開發者ID:opensourcegamedev,項目名稱:SpaceChaos,代碼行數:7,代碼來源:CCircle.java

示例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();
    }
 
開發者ID:MiniDigger,項目名稱:projecttd,代碼行數:46,代碼來源:PathFindingSystem.java

示例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);
}
 
開發者ID:treeman1111,項目名稱:Particles,代碼行數:6,代碼來源:CircleBrush.java


注:本文中的com.badlogic.gdx.graphics.glutils.ShapeRenderer.circle方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。