summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorTom Black <[email protected]>2016-01-01 17:03:56 -0600
committerTom Black <[email protected]>2016-01-01 17:03:56 -0600
commit4b13dc8258d144a8240d5b72906c9d97d4e644de (patch)
tree186f49c230add6d1ca0212e67804e15b23610d05
parent425faa8986ae71438a538b40e996f551866bdf83 (diff)
downloadruby2d-4b13dc8258d144a8240d5b72906c9d97d4e644de.tar.gz
ruby2d-4b13dc8258d144a8240d5b72906c9d97d4e644de.zip
Updating tests
FPS and mouse input
-rw-r--r--lib/ruby2d/window.rb6
-rw-r--r--tests/input.rb16
-rw-r--r--tests/testcard.rb1
3 files changed, 17 insertions, 6 deletions
diff --git a/lib/ruby2d/window.rb b/lib/ruby2d/window.rb
index 1f05bae..322d94c 100644
--- a/lib/ruby2d/window.rb
+++ b/lib/ruby2d/window.rb
@@ -8,7 +8,7 @@ module Ruby2D
@width, @height, @title = width, height, title
@mouse_x = @mouse_y = 0
@fps_cap = fps
- @fps = 0
+ @fps = 60
@vsync = vsync
@objects = []
@@ -86,9 +86,7 @@ module Ruby2D
def on(mouse: nil, key: nil, key_down: nil, controller: nil, &proc)
unless mouse.nil?
- case mouse
- when 'click'
- end
+ # reg_mouse(btn, &proc)
end
unless key.nil?
diff --git a/tests/input.rb b/tests/input.rb
index 44e594d..31f1527 100644
--- a/tests/input.rb
+++ b/tests/input.rb
@@ -10,12 +10,24 @@ on key_down: 's' do
puts "s key down"
end
-on mouse: 'up' do
- puts "mouse up"
+on mouse: 'left' do
+ puts "mouse left"
+end
+
+on mouse: 'right' do
+ puts "mouse right"
end
on mouse: 'down' do
puts "mouse down"
end
+on mouse: 'up' do
+ puts "mouse up"
+end
+
+on mouse: 'any' do
+ puts "mouse any"
+end
+
show
diff --git a/tests/testcard.rb b/tests/testcard.rb
index 0dda5a2..1ab2267 100644
--- a/tests/testcard.rb
+++ b/tests/testcard.rb
@@ -8,6 +8,7 @@ puts "
Title: #{get :title}
Width: #{get :width}
Height: #{get :height}
+FPS: #{get :fps}
Self: #{get :window}\n\n"
# Primary colors