Skip to content

Commit 8cdf0ca

Browse files
authored
Merge pull request #2 from ruby-processing/master
replacing `$app` with Processing.app
2 parents c1032a5 + b1dc56d commit 8cdf0ca

File tree

30 files changed

+34
-34
lines changed

30 files changed

+34
-34
lines changed

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
# JRubyArt-examples for JRubyArt-1.3.4+
2-
Uses a simplified `control_panel` interface, ie use `c.title('PanelTitle')` instead of `c.title = 'PanelTitle'`, the old examples still work with the the latest version of JRubyArt, but these examples require the latest version.
1+
# JRubyArt-examples for JRubyArt-1.4.0+
2+
Replaces `$app` with `Processing.app`, new `library_loader` (_but latter change should be transparent_).
33

44
Description
55
================

contributed/gravity.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ def initialize(x, y, mass)
4848
def collect_force
4949
@x_accel, @y_accel = 0, 0
5050
@min_dist = 1000
51-
$app.particles.each do |p|
51+
Processing.app.particles.each do |p|
5252
next if p == self
5353
g_dist = Math.hypot(x0 - p.x0, y0 - p.y0)
5454
g_theta = -angle_of(x0, y0, p.x0, p.y0)
@@ -69,7 +69,7 @@ def move
6969
end
7070

7171
def grabbed?
72-
$app.grabbed == self
72+
Processing.app.grabbed == self
7373
end
7474

7575
def run

external_library/gem/cf3/isosceles.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class << self
99
size = options[:size]
1010
rot = options[:rotation]
1111
rotate(rot) if rot
12-
$app.triangle(-0.5 * size, -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size, 0.5 * size)
12+
self.app.triangle(-0.5 * size, -0.5 * size, -0.5 * size, 0.5 * size, 0.5 * size, 0.5 * size)
1313
rotate(-rot) if rot
1414
end
1515
end

external_library/gem/pbox2d/distance_joint/boundary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ class Boundary
1313

1414
def initialize(x, y, w, h)
1515
@x, @y, @w, @h = x, y, w, h
16-
@app = $app
16+
@app = Processing.app
1717
# Define the polygon
1818
sd = PolygonShape.new
1919
# Figure out the box2d coordinates

external_library/gem/pbox2d/distance_joint/pair.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ class Pair
99
attr_reader :p1, :p2, :len, :joint
1010
# Chain constructor
1111
def initialize(x, y)
12-
@app = $app
12+
@app = Processing.app
1313
@len = 32
1414
@p1 = Particle.new(x, y)
1515
@p2 = Particle.new(x + rand(-1..1.0), y + rand(-1..1.0))

external_library/gem/pbox2d/distance_joint/particle.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Particle
1212

1313
def initialize(x, y)
1414
@r = 8
15-
@app = $app
15+
@app = Processing.app
1616
# Define a body
1717
bd = BodyDef.new
1818
# Set its position

external_library/gem/pbox2d/mouse_joint/boundary.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Boundary
1212

1313
def initialize(x, y, w, h, a)
1414
@x, @y, @w, @h, @a = x, y, w, h, a
15-
@app = $app
15+
@app = Processing.app
1616
# Define the polygon
1717
sd = PolygonShape.new
1818
# Figure out the box2d coordinates

external_library/gem/pbox2d/mouse_joint/box.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Box
1111
attr_accessor :body, :w, :h
1212
# Constructor
1313
def initialize(x, y)
14-
@app = $app
14+
@app = Processing.app
1515
@w, @h = 24, 24
1616
# Add the box to the box2d world
1717
make_body(Vec2.new(x, y), w, h)

external_library/gem/pbox2d/mouse_joint/spring.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ class Spring
1111
attr_reader :mouse_joint
1212

1313
def initialize
14-
@app = $app
14+
@app = Processing.app
1515
end
1616

1717
# If it exists we set its target to the mouse location

external_library/gem/pbox2d/revolute_joint/box.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ class Box
1616
# Constructor
1717
def initialize(x, y, w, h, lock)
1818
@w, @h = w, h
19-
@app = $app
19+
@app = Processing.app
2020
# Define and create the body
2121
bd = BodyDef.new
2222
bd.position.set(box2d.processing_to_world(Vec2.new(x, y)))

0 commit comments

Comments
 (0)