Tests examples for the miniworldmaker engine https://www.miniworldmaker.de
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
miniworldmaker_cookbook/snippets/8 Events/803_mouse_events (2).py

26 lines
540 B

import miniworldmaker
board = miniworldmaker.TiledBoard()
board.add_background((255, 255, 255, 100))
board.columns = 5
board.rows = 5
board.tile_size = 40
@board.register
def on_mouse_left(self, position):
print("left" + str(position))
@board.register
def on_mouse_right(self, position):
print("right" + str(position))
@board.register
def on_mouse_middle(self, position):
print("middle" + str(position))
@board.register
def on_mouse_motion(self, position):
print("motion" + str(position))
board.run()