rubysketch 0.5.19 → 0.5.21

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: 1ccfda24e6b2342ff8e946b61bcdfa18fc751e6d55a4fd08f3b31ff9c35088b0
4
- data.tar.gz: 748ac2d377d700c504b3149f51829c099ca56c7dce65b9bd61d905eabb0935b4
3
+ metadata.gz: 465b63fb2c047489e7df0a629141c3413acf79d07411309326639ca39d751da0
4
+ data.tar.gz: 9a2adaafb57a38b765b5afe482868b0da0f4c62f7dc98963b865c202246c0637
5
5
  SHA512:
6
- metadata.gz: c9849d91ec8fa229958d3ce120415705be94faef3833d7eeda6c2c7168870570eb8e646905828dab81cef2113628c672b26c9482b8fc42a80636f0e7daa9845a
7
- data.tar.gz: b46818c44fa441f5d1bce35d8aa5d09111ce6a6888e01f7cb54502bb23a69bc7bae41f3d2853cb7989b675684a205054563bd102069b618b199d1766d1ca69fd
6
+ metadata.gz: edd124cb7e330e5193dbd0cb19e669d67913b2910a59d236000e624bf3371bec247bcee5a87f5225bdd822e3801d39df9d3094aed17fe17ec1b9d14629c0fdba
7
+ data.tar.gz: 347152e6d8c121166677cabbf9f28f611f4da284a1251c06e977bb977f59e87db29e9af5649274699b6820d334b25784ef2614e303cdd896c637ef379e905510
data/ChangeLog.md CHANGED
@@ -1,6 +1,17 @@
1
1
  # rubysketch ChangeLog
2
2
 
3
3
 
4
+ ## [v0.5.21] - 2023-07-10
5
+
6
+ - Sprite#contact block receives only contact begin event
7
+ - from_screen() -> fromScreen(), to_screen() -> toScreen()
8
+
9
+
10
+ ## [v0.5.20] - 2023-07-09
11
+
12
+ - fix that calling mousePressed() without block removes mousePressed block
13
+
14
+
4
15
  ## [v0.5.19] - 2023-06-27
5
16
 
6
17
  - add loadSound() and RubySketch::Sound class
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.19
1
+ 0.5.21
@@ -619,7 +619,7 @@ module RubySketch
619
619
  #
620
620
  # @return [Vector] sprite coordinate vector
621
621
  #
622
- def from_screen(vec)
622
+ def fromScreen(vec)
623
623
  @view__.from_parent(vec.getInternal__).toVector
624
624
  end
625
625
 
@@ -629,7 +629,7 @@ module RubySketch
629
629
  #
630
630
  # @return [Vector] screen coordinate vector
631
631
  #
632
- def to_screen(vec)
632
+ def toScreen(vec)
633
633
  @view__.to_parent(vec.getInternal__).toVector
634
634
  end
635
635
 
@@ -699,7 +699,7 @@ module RubySketch
699
699
  # @return [nil] nil
700
700
  #
701
701
  def update(&block)
702
- @view__.update = block
702
+ @view__.update = block if block
703
703
  nil
704
704
  end
705
705
 
@@ -715,7 +715,7 @@ module RubySketch
715
715
  # @return [nil] nil
716
716
  #
717
717
  def draw(&block)
718
- @drawBlock__ = block
718
+ @drawBlock__ = block if block
719
719
  nil
720
720
  end
721
721
 
@@ -729,7 +729,7 @@ module RubySketch
729
729
  # @return [Boolean] is any mouse button pressed or not
730
730
  #
731
731
  def mousePressed(&block)
732
- @view__.mousePressed = block
732
+ @view__.mousePressed = block if block
733
733
  @view__.mousePressed?
734
734
  end
735
735
 
@@ -743,7 +743,7 @@ module RubySketch
743
743
  # @return [nil] nil
744
744
  #
745
745
  def mouseReleased(&block)
746
- @view__.mouseReleased = block
746
+ @view__.mouseReleased = block if block
747
747
  nil
748
748
  end
749
749
 
@@ -757,7 +757,7 @@ module RubySketch
757
757
  # @return [nil] nil
758
758
  #
759
759
  def mouseMoved(&block)
760
- @view__.mouseMoved = block
760
+ @view__.mouseMoved = block if block
761
761
  nil
762
762
  end
763
763
 
@@ -771,7 +771,7 @@ module RubySketch
771
771
  # @return [nil] nil
772
772
  #
773
773
  def mouseDragged(&block)
774
- @view__.mouseDragged = block
774
+ @view__.mouseDragged = block if block
775
775
  nil
776
776
  end
777
777
 
@@ -785,7 +785,7 @@ module RubySketch
785
785
  # @return [nil] nil
786
786
  #
787
787
  def mouseClicked(&block)
788
- @view__.mouseClicked = block
788
+ @view__.mouseClicked = block if block
789
789
  nil
790
790
  end
791
791
 
@@ -799,7 +799,7 @@ module RubySketch
799
799
  # @return [nil] nil
800
800
  #
801
801
  def touchStarted(&block)
802
- @view__.touchStarted = block
802
+ @view__.touchStarted = block if block
803
803
  nil
804
804
  end
805
805
 
@@ -813,7 +813,7 @@ module RubySketch
813
813
  # @return [nil] nil
814
814
  #
815
815
  def touchEnded(&block)
816
- @view__.touchEnded = block
816
+ @view__.touchEnded = block if block
817
817
  nil
818
818
  end
819
819
 
@@ -827,7 +827,7 @@ module RubySketch
827
827
  # @return [nil] nil
828
828
  #
829
829
  def touchMoved(&block)
830
- @view__.touchMoved = block
830
+ @view__.touchMoved = block if block
831
831
  nil
832
832
  end
833
833
 
@@ -841,7 +841,7 @@ module RubySketch
841
841
  # @return [nil] nil
842
842
  #
843
843
  def contact(&block)
844
- @view__.contact = block
844
+ @view__.contact = block if block
845
845
  end
846
846
 
847
847
  # Defines contact? block.
@@ -854,7 +854,7 @@ module RubySketch
854
854
  # @return [nil] nil
855
855
  #
856
856
  def contact?(&block)
857
- @view__.will_contact = block
857
+ @view__.will_contact = block if block
858
858
  end
859
859
 
860
860
  # @private
@@ -907,7 +907,7 @@ module RubySketch
907
907
  end
908
908
 
909
909
  def mouseButton()
910
- ((@pointersPressed + @pointersReleased) & [LEFT, RIGHT, CENTER]).last
910
+ ((@pointersPressed + @pointersReleased) & MOUSE_BUTTONS).last
911
911
  end
912
912
 
913
913
  def clickCount()
@@ -955,7 +955,7 @@ module RubySketch
955
955
  on_pointer_up e
956
956
  end
957
957
 
958
- def on_contact(e)
958
+ def on_contact_begin(e)
959
959
  v = e.view
960
960
  @contact.call v.sprite, e.action if @contact && v.respond_to?(:sprite)
961
961
  end
@@ -973,12 +973,14 @@ module RubySketch
973
973
  mouse_middle: Processing::GraphicsContext::CENTER
974
974
  }
975
975
 
976
+ MOUSE_BUTTONS = MOUSE_BUTTON_MAP.values
977
+
976
978
  def updatePointerStates(event)
977
979
  pointer = event.find {|p| p.id == @pointer&.id} || event.first
978
980
  if !mousePressed? || pointer.id == @pointer&.id
979
981
  @pointerPrev, @pointer = @pointer, pointer.dup
980
982
  end
981
- @touches = event.map {|p| Touch.new(p.id, *p.pos.to_a)}
983
+ @touches = event.map {|p| Processing::Touch.new(p.id, *p.pos.to_a)}
982
984
  end
983
985
 
984
986
  def updatePointersPressedAndReleased(event, pressed)
data/rubysketch.gemspec CHANGED
@@ -29,8 +29,8 @@ Gem::Specification.new do |s|
29
29
  s.add_runtime_dependency 'rucy', '~> 0.1.39'
30
30
  s.add_runtime_dependency 'beeps', '~> 0.1.41'
31
31
  s.add_runtime_dependency 'rays', '~> 0.1.43'
32
- s.add_runtime_dependency 'reflexion', '~> 0.1.47'
33
- s.add_runtime_dependency 'processing', '~> 0.5.20'
32
+ s.add_runtime_dependency 'reflexion', '~> 0.1.48'
33
+ s.add_runtime_dependency 'processing', '~> 0.5.22'
34
34
 
35
35
  s.add_development_dependency 'rake'
36
36
  s.add_development_dependency 'test-unit'
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.5.19
4
+ version: 0.5.21
5
5
  platform: ruby
6
6
  authors:
7
7
  - xordog
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2023-06-26 00:00:00.000000000 Z
11
+ date: 2023-07-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: xot
@@ -72,28 +72,28 @@ dependencies:
72
72
  requirements:
73
73
  - - "~>"
74
74
  - !ruby/object:Gem::Version
75
- version: 0.1.47
75
+ version: 0.1.48
76
76
  type: :runtime
77
77
  prerelease: false
78
78
  version_requirements: !ruby/object:Gem::Requirement
79
79
  requirements:
80
80
  - - "~>"
81
81
  - !ruby/object:Gem::Version
82
- version: 0.1.47
82
+ version: 0.1.48
83
83
  - !ruby/object:Gem::Dependency
84
84
  name: processing
85
85
  requirement: !ruby/object:Gem::Requirement
86
86
  requirements:
87
87
  - - "~>"
88
88
  - !ruby/object:Gem::Version
89
- version: 0.5.20
89
+ version: 0.5.22
90
90
  type: :runtime
91
91
  prerelease: false
92
92
  version_requirements: !ruby/object:Gem::Requirement
93
93
  requirements:
94
94
  - - "~>"
95
95
  - !ruby/object:Gem::Version
96
- version: 0.5.20
96
+ version: 0.5.22
97
97
  - !ruby/object:Gem::Dependency
98
98
  name: rake
99
99
  requirement: !ruby/object:Gem::Requirement