Skip to content

Instantly share code, notes, and snippets.

@Groogy
Last active Jul 24, 2017
Embed
What would you like to do?
receiver = Boleite::InputReceiver.new
receiver.action_table << Boleite::DefaultAction.new :close
receiver.action_table << Boleite::MoveCameraAction.new :player_camera
receiver.register :close, ->() { puts "Closing!" }
receiver.register :player_camera, ->(x : Float64, y : Float64) { puts "Moving camera!" }
receiver.process Boleite::ClosedEvent.new
receiver.process Boleite::MouseMovedEvent.new(some_x, some_y)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment