Skip to content

Commit 253e624

Browse files
committed
fix docs?
1 parent 609d311 commit 253e624

File tree

5 files changed

+13
-1
lines changed

5 files changed

+13
-1
lines changed

docs/_methods/init_options.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ permalink: /methods/init_options/
66

77
### init_options method ###
88
Need not called directly if using [WorldBuilder][world_builder]
9+
910
```ruby
1011
def init_options(args = {})
1112
args = defaults.merge(args)
@@ -19,6 +20,7 @@ end
1920

2021
### related default options ###
2122
Provides defaults for init_options
23+
2224
```ruby
2325
def defaults
2426
{ scale: 10.0, gravity: [0, -10], warm: true, continuous: true }

docs/_methods/processing_to_world.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ Because of the peculiar choice by the processing guys down is up (dimensions in
1010

1111
The java code ([PBox2D][pbox2d] inherits this from [Box2DProcessing][pbox2d])
1212
### public Vec2 processingToWorld(float worldX, float worldY) ###
13+
1314
```java
1415
public Vec2 processingToWorld(float pixelX, float pixelY) {
1516
float worldX = map(pixelX, parent.width / 2, parent.width / 2 + scaleFactor, 0f, 1f);
@@ -20,6 +21,7 @@ public Vec2 processingToWorld(float pixelX, float pixelY) {
2021

2122
### Ruby usage ###
2223
Use camel case
24+
2325
```ruby
2426
processing_to_world(x, y) # returns new Vec2 instance (in the PBox2D world)
2527
```

docs/_methods/scale_to_processing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ From sketch to physics world and vice versa
77

88
The java code ([PBox2D][pbox2d] inherits this from [Box2DProcessing][pbox2d])
99
### public float scaleToProcessing(float val) ###
10+
1011
```java
1112
public float scaleToProcessing(float val) {
1213
return val * scaleFactor;
@@ -15,6 +16,7 @@ public float scaleToProcessing(float val) {
1516

1617
### Ruby usage ###
1718
Use camel case
19+
1820
```ruby
1921
scale_to_processing(val)
2022
```

docs/_methods/world_to_processing.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ Because of the peculiar choice by the processing guys down is up (dimensions in
1111

1212
The java code ([PBox2D][pbox2d] inherits this from [Box2DProcessing][pbox2d])
1313
### public Vec2 worldToProcessing(float worldX, float worldY) ###
14+
1415
```java
1516
public Vec2 worldToProcessing(float worldX, float worldY) {
1617
float pixelX = map(worldX, 0f, 1f, parent.width / 2, parent.width / 2 + scaleFactor);
@@ -21,6 +22,7 @@ public Vec2 worldToProcessing(float worldX, float worldY) {
2122

2223
### Ruby usage ###
2324
Use camel case
25+
2426
```ruby
2527
world_to_processing(x, y) # returns new Vec2 instance (in processing world)
2628
```

docs/_posts/2016-10-14-welcome.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,8 +14,12 @@ attr_reader :box2d, :boundaries, :boxes
1414
```
1515
You then need to create an instance of `Box2D` in the setup
1616
```ruby
17-
def setup
17+
def settings
1818
size(400,300)
19+
end
20+
21+
def setup
22+
sketch_title 'pbox2d sketch'
1923
@box2d = WorldBuilder.build(app: self, gravity: [0, -20])
2024
```
2125

0 commit comments

Comments
 (0)