/** @see #polyline(float[], int, int) */ public void polyline (float[] vertices) { polyline(vertices, 0, vertices.length); }
/** @see #polyline(float[], int, int) */ public void polyline (float[] vertices) { polyline(vertices, 0, vertices.length); }
shapeRenderer.begin(ShapeRenderer.ShapeType.Line); Polyline polyline = ((PolylineMapObject)mapObject).getPolyline(); shapeRenderer.polyline(polyline.getTransformedVertices()); shapeRenderer.end();
/** @see #polyline(float[], int, int) */ public void polyline (float[] vertices) { polyline(vertices, 0, vertices.length); }
@Override public void render () { Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); shapeRenderer.begin(ShapeType.Line); shapeRenderer.polyline(dragonCurve); shapeRenderer.end(); } }
shapeRenderer.polyline(floatDots);
@Override public void render() { // As always, first we clear the screen Gdx.gl.glClearColor(0, 0, 0, 1); Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); // Then we start our shapeRenderer batch, this time with ShapeType.Line shapeRenderer.begin(ShapeType.Line); // A Simple white line shapeRenderer.setColor(Color.WHITE); shapeRenderer.line(0, 0, 100, 100); // We can set different colors using two methods. We can use constants like so. shapeRenderer.setColor(Color.MAGENTA); shapeRenderer.line(10, 0, 110, 100); // We can also set a color using RGBA values shapeRenderer.setColor(0, 1, 0, 1); shapeRenderer.line(20, 0, 120, 100); // We can also do fancy things like gradients shapeRenderer.line(30, 0, 130, 100, Color.BLUE, Color.RED); // The last interesting thing we can do is draw a bunch of connected line segments using polyline // First we set up the list of vertices, where the even positions are x coordinates, and the odd positions are the y coordinates float[] verticies = {100, 200, 300, 300, 200, 300, 300, 200}; shapeRenderer.polyline(verticies); // Finally, as always, we end the batch shapeRenderer.end(); } }
sr.line(p1, p2); sr.line(collision, normal); sr.polyline(aabb); sr.end();
shapeRenderer.begin(ShapeType.Line); shapeRenderer.setColor(Color.ORANGE); shapeRenderer.polyline(debugFunction); shapeRenderer.end();