Test to check that SFML::RenderWindow and shapes works as they should.
git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1697 4e206d99-4929-0410-ac5d-dfc041789085
This commit is contained in:
parent
aaf1dc3a66
commit
7178d7bfcf
24
bindings/ruby/testing/render-window-demo.rb
Normal file
24
bindings/ruby/testing/render-window-demo.rb
Normal file
@ -0,0 +1,24 @@
|
||||
require 'sfml/system'
|
||||
require 'sfml/window'
|
||||
require 'sfml/graphics'
|
||||
|
||||
app = SFML::RenderWindow.new( [800, 600], "My Ruby SFML" )
|
||||
app.framerate = 100
|
||||
app.position = [300, 300]
|
||||
input = app.input
|
||||
|
||||
shape = SFML::Shape.rectangle( [-10, -10, 20, 20], SFML::Color::White )
|
||||
|
||||
while app.open?
|
||||
while event = app.get_event
|
||||
if event.type == SFML::Event::Closed
|
||||
app.close
|
||||
end
|
||||
end
|
||||
|
||||
|
||||
app.clear
|
||||
shape.position = [input.mouseX, input.mouseY]
|
||||
app.draw shape
|
||||
app.display
|
||||
end
|
Loading…
Reference in New Issue
Block a user