Skip to content

Commit 31f1a68

Browse files
author
Jeremy Silver
committed
update 1.3.03
1 parent b08e4e8 commit 31f1a68

File tree

2 files changed

+13
-9
lines changed

2 files changed

+13
-9
lines changed

1.3.03-Demo-DrawingLines/README.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
# Drawing Lines
2+
3+
Again, there's not a lot to say in the way of background. Open the TODO panel to jump to the code of interest!

1.3.03-Demo-DrawingLines/core/src/com/udacity/gamedev/drawinglines/DrawingLines.java

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,20 +7,21 @@
77
import com.badlogic.gdx.graphics.glutils.ShapeRenderer;
88
import com.badlogic.gdx.graphics.glutils.ShapeRenderer.ShapeType;
99

10-
/*
11-
12-
TODO: Start Here!
13-
14-
In this demo, we'll use ShapeRenderer to draw some lines!
15-
10+
/**
11+
* TODO: Start Here!
12+
*
13+
* In this demo, we'll use ShapeRenderer to draw some lines! We'll use most of the line drawing
14+
* methods offered by ShapeRenderer, but remember to check out the Javadocs for the full story. If
15+
* you're lazy, you can just Google "LibGDX ShapeRenderer", and you'll find what you're looking
16+
* for!
1617
*/
1718

1819
public class DrawingLines extends ApplicationAdapter {
1920

2021
ShapeRenderer shapeRenderer;
2122

2223
@Override
23-
public void create () {
24+
public void create() {
2425
// Remember we want to create our ShapeRenderer outside of our render callback
2526
shapeRenderer = new ShapeRenderer();
2627
}
@@ -33,7 +34,7 @@ public void dispose() {
3334
}
3435

3536
@Override
36-
public void render () {
37+
public void render() {
3738
// As always, first we clear the screen
3839
Gdx.gl.glClearColor(0, 0, 0, 1);
3940
Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT);
@@ -52,7 +53,7 @@ public void render () {
5253
shapeRenderer.line(30, 0, 130, 100, Color.BLUE, Color.RED);
5354
// The last interesting thing we can do is draw a bunch of connected line segments using polyline
5455
// First we set up the list of vertices, where the even positions are x coordinates, and the odd positions are the y coordinates
55-
float[] verticies = {100, 200, 300, 300, 200, 300, 300, 200};
56+
float[] verticies = {100, 200, 300, 300, 200, 300, 300, 200};
5657
shapeRenderer.polyline(verticies);
5758
// Finally, as always, we end the batch
5859
shapeRenderer.end();

0 commit comments

Comments
 (0)