Stuff I'm working on.

Thursday, 9 July 2015

pySFML Mouse Single Click

See as there isn't much decent documentation for pySFML that I can find, I'll put this here as a reference snippet for using the input events.

for event in
 if type(event) is sf.CloseEvent:

 if type(event) is sf.KeyEvent and event.code is sf.Keyboard.ESCAPE:
 if type(event) is sf.window.MouseButtonEvent and event.button is sf.Mouse.LEFT and event.pressed:
  self.mousePos = sf.Mouse.get_position(self.window)