summaryrefslogtreecommitdiffhomepage
path: root/test/mouse.rb
diff options
context:
space:
mode:
authorlstrzebinczyk <[email protected]>2017-05-27 20:56:35 +0200
committerTom Black <[email protected]>2017-06-03 20:30:43 -0400
commit3a694ffebcff71305d79c6e8c15246d671ce3888 (patch)
tree0c5ea151fa8ad76aa2e4feb447d6fe9efef1c409 /test/mouse.rb
parent65187cd5126227778146ec33c2857a391fbab620 (diff)
downloadruby2d-3a694ffebcff71305d79c6e8c15246d671ce3888.tar.gz
ruby2d-3a694ffebcff71305d79c6e8c15246d671ce3888.zip
Use named arguments (#65)
Diffstat (limited to 'test/mouse.rb')
-rw-r--r--test/mouse.rb12
1 files changed, 6 insertions, 6 deletions
diff --git a/test/mouse.rb b/test/mouse.rb
index 7daa738..77a0464 100644
--- a/test/mouse.rb
+++ b/test/mouse.rb
@@ -6,10 +6,10 @@ on :mouse do |event|
puts event
end
-s1 = Square.new(5, 5, 25, [1, 1, 0, 1]) # mouse down square
-s2 = Square.new(188, 10, 25) # mouse scroll square
-s3 = Square.new(188, 137, 25, [1, 1, 1, 1]) # mouse move delta square
-s4 = Square.new(35, 5, 10) # mouse move position square
+s1 = Square.new(x: 5, y: 5, size: 25, color: [1, 1, 0, 1]) # mouse down square
+s2 = Square.new(x: 188, y: 10, size: 25) # mouse scroll square
+s3 = Square.new(x: 188, y: 137, size: 25) # mouse move delta square
+s4 = Square.new(x: 35, y: 5, size: 10) # mouse move position square
on :mouse_down do |event|
case event.button
@@ -43,8 +43,8 @@ on :mouse_move do |event|
end
# Crosshairs
-Rectangle.new(199, 0, 2, 300, [1, 0, 0, 1])
-Rectangle.new(0, 149, 400, 2, [1, 0, 0, 1])
+Rectangle.new(x: 199, y: 0, width: 2, height: 300, color: [1, 0, 0, 1])
+Rectangle.new(x: 0, y: 149, width: 400, height: 2, color: [1, 0, 0, 1])
on :key_down do |event|
close if event.key == 'escape'