mirror of
https://github.com/SFML/SFML.git
synced 2024-11-29 14:51:06 +08:00
26883e3ab4
(Example: SFML::Window#cursor_position = [255, 255] ) Updated the demo file to show this in action. git-svn-id: https://sfml.svn.sourceforge.net/svnroot/sfml/branches/sfml2@1655 4e206d99-4929-0410-ac5d-dfc041789085
20 lines
339 B
Ruby
20 lines
339 B
Ruby
require 'sfml/system'
|
|
require 'sfml/window'
|
|
|
|
app = SFML::Window.new( [800, 600], "My Ruby SFML" )
|
|
app.framerate = 100
|
|
app.position = [300, 300]
|
|
input = app.input
|
|
|
|
while app.open?
|
|
while event = app.get_event
|
|
if event.type == SFML::Event::Closed
|
|
app.close
|
|
end
|
|
end
|
|
|
|
p [input.mouse_x, input.mouse_y]
|
|
|
|
app.display
|
|
end
|