Skip to content

Commit bb37e6c

Browse files
committed
fix mouse joint example
1 parent 9e551e6 commit bb37e6c

File tree

3 files changed

+7
-5
lines changed

3 files changed

+7
-5
lines changed

external_library/gem/pbox2d/mouse_joint/boundary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ def display
3636
stroke(127)
3737
fill(127)
3838
stroke_weight(1)
39-
rect_mode(Java::ProcessingCore::CENTER)
39+
rect_mode(Java::ProcessingCore::PConstants::CENTER)
4040
a = b.get_angle
4141
push_matrix
4242
translate(x, y)

external_library/gem/pbox2d/mouse_joint/box.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# The Nature of Code
22
# Daniel Shiffman
33
# http://natureofcode.com
4-
4+
require 'forwardable'
55
# A rectangular box
66
class Box
77
extend Forwardable
@@ -34,7 +34,7 @@ def display
3434
pos = box2d.body_coord(body)
3535
# Get its angle of rotation
3636
a = body.getAngle
37-
rect_mode(Java::ProcessingCore::CENTER)
37+
rect_mode(Java::ProcessingCore::PConstants::CENTER)
3838
push_matrix
3939
translate(pos.x, pos.y)
4040
rotate(a)

external_library/gem/pbox2d/mouse_joint/mouse_joint.rb

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,13 +9,15 @@
99
require_relative 'boundary'
1010
require_relative 'spring'
1111
require_relative 'dummy_spring'
12-
require 'forwardable'
1312

1413
# A reference to our box2d world
1514
attr_reader :box2d, :boundaries, :box, :spring
15+
def settings
16+
size(640, 360)
17+
end
1618

1719
def setup
18-
size(640, 360)
20+
sketch_title('Mouse Joint')
1921
# Initialize box2d physics and create the world
2022
@box2d = Box2D.new self
2123
box2d.create_world

0 commit comments

Comments
 (0)