rubysketch 0.3.8 → 0.3.9

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: b5824abb04b555aa085934c3eefb32dc0cf5a79c6bc48945d5706a260c46269d
4
- data.tar.gz: 35d88e63413027b4c8c574b860c2dd9e443cb29f140e9820ec73bacaaf800f05
3
+ metadata.gz: 5a3690207d8b2a8c6bfe3b556e9e1267e3508bcd757952fc738ce2594844a6a5
4
+ data.tar.gz: '0112280fc01e89633adff2ebbccc012ceab1bdcd9271dc9d6f14d8c9969ca586'
5
5
  SHA512:
6
- metadata.gz: 34eaeef4a6992cfa326e16bd58b07e27b4757876129d03d246b717d334620d87d6a412f61757545bd4db561f83f38d8dd9303d255276ae0a544a4731759d853c
7
- data.tar.gz: f0f4d8498f19da6a602cb4b120e91cdaebb718e66d4980433cb2386e0ed45e47aeefd25adb2c03974a93fefe2f862783325cd8c1cf923174f8467825172d647b
6
+ metadata.gz: bad81197d43586840b8f6828dd3f267a131017796d988bb958969b4fcc3cae7bcf41eca4123ce9f38039dab69195859cd3bb96a8afe1eda650a3abacd92a6944
7
+ data.tar.gz: de7e3c7bb04cdf8ac3f90893277e20b671073ebe03197c9a31987cdb5324e7e0ce07659064bce787115713c95471bdacec4323a29ce0a2bf22ad8d2b7cff6937
data/Rakefile CHANGED
@@ -23,3 +23,28 @@ generate_documents
23
23
  build_ruby_gem
24
24
 
25
25
  task :default => :test
26
+
27
+
28
+ namespace :version do
29
+
30
+ namespace :bump do
31
+
32
+ task :major do
33
+ update_and_tag_version 0
34
+ end
35
+
36
+ task :minor do
37
+ update_and_tag_version 1
38
+ end
39
+
40
+ task :patch do
41
+ update_and_tag_version 2
42
+ end
43
+
44
+ task :build do
45
+ update_and_tag_version 3
46
+ end
47
+
48
+ end# bump
49
+
50
+ end# version
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.8
1
+ 0.3.9
@@ -5,7 +5,7 @@
5
5
  require 'rubysketch-processing'
6
6
 
7
7
 
8
- cam = Capture.new 300, 200, Capture.list.last
8
+ cam = Capture.new 300, 300
9
9
  cam.start
10
10
 
11
11
  draw do
@@ -0,0 +1,33 @@
1
+ %w[xot rays reflex rubysketch]
2
+ .map {|s| File.expand_path "../../#{s}/lib", __dir__}
3
+ .each {|s| $:.unshift s if !$:.include?(s) && File.directory?(s)}
4
+
5
+ require 'rubysketch-processing'
6
+
7
+
8
+ w, h = width, height
9
+
10
+ cam = Capture.new w, h, Capture.list.last
11
+ cam.start
12
+
13
+ images = 60.times.map {
14
+ Graphics.new w, h
15
+ }
16
+
17
+ draw do
18
+ if frameCount % 2 == 0
19
+ images.unshift images.pop
20
+ images.first.tap do |image|
21
+ image.beginDraw {
22
+ image.image cam, 0, 0
23
+ }
24
+ end
25
+ end
26
+
27
+ background 0
28
+ segment_h= h / images.size
29
+ images.each.with_index do |image, i|
30
+ y = i * segment_h
31
+ copy image, 0, y, w, segment_h, 0, y, w, segment_h
32
+ end
33
+ end
@@ -767,11 +767,11 @@ module RubySketch
767
767
 
768
768
  # Start capturing.
769
769
  #
770
- # @return [Capture] self
770
+ # @return [nil] nil
771
771
  #
772
772
  def start ()
773
773
  raise "Failed to start capture" unless @camera.start
774
- self
774
+ nil
775
775
  end
776
776
 
777
777
  # Stop capturing.
@@ -940,13 +940,15 @@ module RubySketch
940
940
  stroke 0
941
941
  end
942
942
 
943
- def beginDraw ()
943
+ # @private
944
+ def beginDraw__ ()
944
945
  @matrixStack__.clear
945
946
  @styleStack__.clear
946
947
  @drawing__ = true
947
948
  end
948
949
 
949
- def endDraw ()
950
+ # @private
951
+ def endDraw__ ()
950
952
  @drawing__ = false
951
953
  end
952
954
 
@@ -1716,17 +1718,21 @@ module RubySketch
1716
1718
 
1717
1719
  # Start drawing.
1718
1720
  #
1719
- def beginDraw ()
1721
+ def beginDraw (&block)
1720
1722
  @painter__.__send__ :begin_paint
1721
- super
1723
+ beginDraw__
1722
1724
  push
1725
+ if block
1726
+ block.call
1727
+ endDraw
1728
+ end
1723
1729
  end
1724
1730
 
1725
1731
  # End drawing.
1726
1732
  #
1727
1733
  def endDraw ()
1728
1734
  pop
1729
- super
1735
+ endDraw__
1730
1736
  @painter__.__send__ :end_paint
1731
1737
  end
1732
1738
 
@@ -1765,8 +1771,8 @@ module RubySketch
1765
1771
  @mousePressed__ = false
1766
1772
  @touches__ = []
1767
1773
 
1768
- @window__.before_draw = proc {beginDraw}
1769
- @window__.after_draw = proc {endDraw}
1774
+ @window__.before_draw = proc {beginDraw__}
1775
+ @window__.after_draw = proc {endDraw__}
1770
1776
 
1771
1777
  drawFrame = -> {
1772
1778
  @image__ = @window__.canvas
@@ -12,11 +12,6 @@ require 'rubysketch'
12
12
  include Xot::Test
13
13
 
14
14
 
15
- unless $RAYS_NOAUTOINIT
16
- #def Rays.fin! () end
17
- end
18
-
19
-
20
15
  def assert_equal_vector (v1, v2, delta = 0.000001)
21
16
  assert_in_delta v1.x, v2.x, delta
22
17
  assert_in_delta v1.y, v2.y, delta
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rubysketch
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.8
4
+ version: 0.3.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-11-26 00:00:00.000000000 Z
11
+ date: 2020-11-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: reflexion
@@ -43,6 +43,7 @@ files:
43
43
  - examples/breakout.rb
44
44
  - examples/camera.rb
45
45
  - examples/clock.rb
46
+ - examples/delay_camera.rb
46
47
  - examples/glsl.rb
47
48
  - examples/hello.rb
48
49
  - examples/image.rb