texplay 0.2.3 → 0.2.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/CHANGELOG +5 -0
- data/README.markdown +1 -1
- data/Rakefile +1 -1
- data/examples/example_lsystem.rb +2 -2
- data/lib/texplay-contrib.rb +5 -8
- data/lib/texplay.rb +1 -1
- metadata +1 -1
data/CHANGELOG
CHANGED
data/README.markdown
CHANGED
data/Rakefile
CHANGED
data/examples/example_lsystem.rb
CHANGED
@@ -38,8 +38,8 @@ end
|
|
38
38
|
class W < Gosu::Window
|
39
39
|
def initialize
|
40
40
|
super(1024, 768, false, 20)
|
41
|
-
@img = TexPlay::create_blank_image(self,
|
42
|
-
@img.lsystem(
|
41
|
+
@img = TexPlay::create_blank_image(self, 500, 500)
|
42
|
+
@img.lsystem(0, 250, Bush2, :order => 5, :line_length => 5)
|
43
43
|
end
|
44
44
|
|
45
45
|
def draw
|
data/lib/texplay-contrib.rb
CHANGED
@@ -5,13 +5,9 @@ end
|
|
5
5
|
|
6
6
|
require 'texplay'
|
7
7
|
|
8
|
-
#
|
9
|
-
|
10
|
-
|
11
|
-
alias_method :_each_char, :each_byte
|
12
|
-
else
|
13
|
-
alias_method :_each_char, :each_char
|
14
|
-
end
|
8
|
+
# to bring in String#each_char for 1.8
|
9
|
+
if RUBY_VERSION =~ /1.8/
|
10
|
+
require 'jcode'
|
15
11
|
end
|
16
12
|
|
17
13
|
# setup will be executed straight after Gosu::Image instantiation
|
@@ -135,7 +131,8 @@ TexPlay::create_macro(:lsystem) do |x, y, system, options|
|
|
135
131
|
move_to(x, y)
|
136
132
|
line_length = options[:line_length] || 1
|
137
133
|
|
138
|
-
system.produce_string(options).
|
134
|
+
system.produce_string(options).each_char do |v|
|
135
|
+
|
139
136
|
case v
|
140
137
|
when "F"
|
141
138
|
forward(line_length, true)
|
data/lib/texplay.rb
CHANGED