Skip to content

Commit 012b48d

Browse files
committed
add README.md
1 parent f68bfed commit 012b48d

File tree

6 files changed

+64
-4
lines changed

6 files changed

+64
-4
lines changed

data_path/README.md

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
### Installing libraries ###
2+
For libraries other than `sound` and `video` eg `pdf` you need to copy the library folder to `~/.propane/libraries` (_ie just like the installer does for video and sound_). Same is true for external libraries like `hype` (renaming to lower case as required eg `~/.propane/libraries/hype/library/hype.jar`).
3+
4+
Interestingly the `pdf` library from processing-2.2.1 seems to work just fine with `propane-1.2.2`.
5+

data_path/complex_3D.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ class Complex3D < Propane::App
1212
attr_reader :num, :pt, :style, :dosave
1313

1414
def setup
15-
sketch_title 'Complex 3 D'
15+
sketch_title 'Complex 3D'
1616
background(255)
1717
@dosave = false
1818
@num = 150

regular/25_squares.rb

+56
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
#!/usr/bin/env jruby -v -w
2+
# frozen_string_literal: true
3+
4+
require 'propane'
5+
6+
class VeraMolnar < Propane::App
7+
# Creative Coding
8+
# # # # #
9+
# Vera Molnar – 25 Squares
10+
# # # # #
11+
# Interpretation by Martin Vögeli
12+
# Converted to JRubyArt Martin Prout
13+
# # # # #
14+
# Based on code by Indae Hwang and Jon McCormack
15+
#
16+
17+
def settings
18+
size(600, 600)
19+
end
20+
21+
def setup
22+
sketch_title '25 Squares'
23+
rect_mode(CORNER)
24+
no_stroke
25+
frame_rate(1) # set the frame rate to 1 draw call per second
26+
end
27+
28+
def draw
29+
background(180) # clear the screen to grey
30+
grid_size = 5 # rand(3..12) # select a rand number of squares each frame
31+
gap = 5 # rand(5..50) # select a rand gap between each square
32+
# calculate the size of each square for the given number of squares and gap between them
33+
cellsize = (width - (grid_size + 1) * gap) / grid_size
34+
# calculate shadow offset
35+
offset_x = cellsize / 16.0
36+
offset_y = cellsize / 16.0
37+
grid_size.times do |i|
38+
grid_size.times do |j|
39+
# fill(140, 180) # shadow
40+
# rect(gap * (i + 1) + cellsize * i + offset_x, gap * (j + 1) + cellsize * j + offset_y, cellsize, cellsize)
41+
if rand(0..5) > 4
42+
fill(color('#a11220'), 180.0) # Note how to create transparent fill with web color JRubyArt
43+
else
44+
fill(color('#884444'), 180.0)
45+
end
46+
rect(gap * (i + 1) + cellsize * i + rand(-5..5), gap * (j + 1) + cellsize * j + rand(-5..5), cellsize, cellsize)
47+
end
48+
end
49+
# save your drawings when you press keyboard 's' continually
50+
if (key_pressed? && key == 's')
51+
save_frame('######.jpg')
52+
end
53+
end #end of draw
54+
end # class
55+
56+
VeraMolnar.new

regular/arcball_box.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
class ArcballBox < Propane::App
1313

14-
def setup
14+
def settings
1515
size(600, 600, P3D)
1616
smooth(8)
1717
end

regular/grey_circles.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55

66
class GreyCircles < Propane::App
77

8-
def setup
8+
def settings
99
size(323, 200)
1010
smooth
1111
end

regular/words.rb

-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
# encoding: utf-8
21
# frozen_string_literal: true
32
require 'propane'
43
# Words.

0 commit comments

Comments
 (0)