Skip to content

Commit 1e32821

Browse files
committed
even more data_path stuff
1 parent 87dacf5 commit 1e32821

File tree

8 files changed

+9
-16
lines changed

8 files changed

+9
-16
lines changed

external_library/java/hype/Rakefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ end
2222

2323
def run_sample(sample_name)
2424
puts "Running #{sample_name}...quit to run next sample"
25-
open("|k9 --nojruby run #{sample_name}", "r") do |io|
25+
open("|k9 run #{sample_name}", "r") do |io|
2626
while l = io.gets
2727
puts(l.chop)
2828
end

external_library/java/hype/h_canvas.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ def setup
2727
sketch_title 'Scanlines GLSL sketch'
2828
H.init(self)
2929
H.background(color('#000000'))
30-
@my_shader = load_shader('scanlines.glsl')
30+
@my_shader = load_shader(data_path('scanlines.glsl'))
3131
my_shader.set('resolution', 1.0, 1.0)
3232
my_shader.set('screenres', width.to_f, height.to_f)
3333
my_shader.set('time', millis / 1000.0)

external_library/java/hype/magnetic_field.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ def setup
3232

3333
@pool = HDrawablePool.new(2_500)
3434
pool.auto_add_to_stage
35-
.add(HShape.new('arrow.svg').enable_style(false).anchor_at(H::CENTER))
35+
.add(HShape.new(data_path('arrow.svg')).enable_style(false).anchor_at(H::CENTER))
3636
.layout(Hype::HGridLayout.new.start_x(-60).start_y(-60).spacing(16, 16).cols(50))
3737
.on_create do |obj|
3838
obj.no_stroke.anchor(-20, -20)

processing_app/basics/color/reading/reading.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ def setup
66
sketch_title 'Read Color'
77
no_stroke
88
background 0
9-
c = load_image 'cait.jpg'
9+
c = load_image(data_path('cait.jpg'))
1010
xoff, yoff = 0, 0
1111
p = 2
1212
pix = p * 3

processing_app/basics/web/embedded_links.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def check_buttons
3939
@over_right_button = inside? mouse_x, mouse_y, (105..180), (60..135)
4040
end
4141

42-
def inside? ( x, y, x_bound, y_bound )
42+
def inside?(x, y, x_bound, y_bound)
4343
x_bound.cover?(x) && y_bound.cover?(y)
4444
end
4545

processing_app/library/video/capture/ascii_capture.rb

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ def setup
2020
sketch_title 'Ascii Capture'
2121
init_video
2222
@font_size = 1.5
23-
@font = load_font('UniversLTStd-Light-48.vlw')
23+
@font = load_font(data_path('UniversLTStd-Light-48.vlw'))
2424
# for the 256 levels of brightness, distribute the letters across
2525
# the an array of 256 elements to use for the lookup
2626
@letters = (0...256).map do |i|
@@ -111,4 +111,3 @@ def key_pressed
111111
def settings
112112
size(960, 544, P2D)
113113
end
114-

processing_app/library/video/capture/background_subtraction.rb

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,4 +76,3 @@ def key_pressed
7676
def settings
7777
size(960, 544, P2D)
7878
end
79-

processing_app/library/video/capture/black_white_capture.rb

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,16 @@
11
# hold down mouse to see unfiltered output
2-
require_relative 'video_event'
3-
4-
load_libraries :video
5-
include_package 'processing.video'
6-
7-
include Java::MonkstoneVideoevent::VideoInterface
2+
load_libraries :video, :video_event
83

94
attr_reader :cam, :my_shader
105

116
def setup
127
sketch_title 'Black & White Capture'
13-
@my_shader = load_shader('bwfrag.glsl')
8+
@my_shader = load_shader(data_path('bwfrag.glsl'))
149
start_capture(width, height)
1510
end
1611

1712
def start_capture(w, h)
18-
@cam = Capture.new(self, w, h)
13+
@cam = Java::ProcessingVideo::Capture.new(self, w, h)
1914
cam.start
2015
end
2116

0 commit comments

Comments
 (0)