本文整理汇总了Java中com.badlogic.gdx.graphics.glutils.ShapeRenderer.set方法的典型用法代码示例。如果您正苦于以下问题:Java ShapeRenderer.set方法的具体用法?Java ShapeRenderer.set怎么用?Java ShapeRenderer.set使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类com.badlogic.gdx.graphics.glutils.ShapeRenderer
的用法示例。
在下文中一共展示了ShapeRenderer.set方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: draw
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
public void draw(ShapeRenderer renderer) {
if (rect.width < 25 * cam.zoom || rect.height < 25 * cam.zoom) return;
Gdx.gl.glEnable(GL20.GL_BLEND);
Gdx.gl.glBlendFunc(GL20.GL_SRC_ALPHA, GL20.GL_ONE_MINUS_SRC_ALPHA);
renderer.setProjectionMatrix(cam.combined);
renderer.begin(ShapeRenderer.ShapeType.Filled);
renderer.setColor(new Color(0x228b2255));
renderer.rect(rect.x, rect.y, rect.width, rect.height);
renderer.set(ShapeRenderer.ShapeType.Line);
renderer.setColor(Color.BLACK);
renderer.rect(rect.x, rect.y, rect.width, rect.height);
renderer.end();
}
示例2: render
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void render(SpriteBatch sb, ShapeRenderer sr) {
sb.setProjectionMatrix(camera.combined);
sr.setAutoShapeType(true);
sr.setProjectionMatrix(camera.combined);
//SHAPERENDERER
sr.begin();
sr.set(ShapeRenderer.ShapeType.Filled);
sr.setColor(new Color(23 / 255f, 23 / 255f, 23 / 255f, 1f));
sr.rect(0, 0, Game.WIDTH, Game.HEIGHT);
for (int i = 0; i < background.length; i++) {
background[i].renderSR(sr);
}
play.renderSR(sr);
music.renderSR(sr);
sr.end();
//SPRITEBATCH
sb.begin();
sb.draw(logo, Game.WIDTH / 2 - (logo.getTexture().getWidth() * 10) / 2, Game.HEIGHT - 50 - logo.getHeight() * 10, logo.getWidth() * 10, logo.getHeight() * 10);
play.renderSB(sb);
music.renderSB(sb);
betaText.draw(sb, "Beta Release - Copyright 2017 Gussio. All rights reserved. Visit https://gussio.nl/ for more info.", 10, 25);
sb.end();
}
示例3: render
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void render(SpriteBatch sb, ShapeRenderer sr) {
sb.setProjectionMatrix(camera.combined);
sr.setAutoShapeType(true);
sr.setProjectionMatrix(camera.combined);
//BACKGROUND
sr.begin();
sr.set(ShapeRenderer.ShapeType.Filled);
sr.setColor(Color.WHITE);
sr.rect(0, 0, Game.WIDTH, Game.HEIGHT);
sr.end();
//LOGO
sb.begin();
sb.draw(logo, Game.WIDTH / 2 - logo.getWidth() * 20 / 2, Game.HEIGHT / 2 - logo.getHeight() * 20 / 2, logo.getWidth() * 20, logo.getHeight() * 20);
sb.end();
}
示例4: 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.Filled);
shapeRenderer.rect(this.x, this.y, x + (width / 2), y + (height / 2), this.width, this.height, 1f, 1f,
this.angle);
}
示例5: drawPath
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
public static void drawPath(ArrayList<Node> path , ShapeRenderer sr , OrthographicCamera camera){
sr.setAutoShapeType(true);
sr.setProjectionMatrix(camera.combined);
sr.begin();
for(Node node : path){
Vector2 start = node.getParent() != null ? node.getParent().getCordinates().cpy().scl(32) : LevelManager.tileSpawn.getTileCenter();
sr.setColor(Color.WHITE);
sr.set(ShapeType.Line);
sr.line(start , node.getCordinates().cpy().scl(32));
}
sr.end();
}
示例6: 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);
}
示例7: 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);
}
示例8: 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.rect(this.getX(), this.getY(), this.width, this.height);
}
示例9: renderSR
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void renderSR(ShapeRenderer sr) {
sr.set(ShapeRenderer.ShapeType.Filled);
sr.setColor(Color.RED);
sr.rect(x, y, 5, 5);
}
示例10: renderSR
import com.badlogic.gdx.graphics.glutils.ShapeRenderer; //导入方法依赖的package包/类
@Override
public void renderSR(ShapeRenderer sr) {
sr.setColor(color);
sr.set(ShapeRenderer.ShapeType.Filled);
sr.rect(x, y, size, size);
}
示例11: 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);
}