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/804_b_mouse_token_events.py

17 lines
390 B

import miniworldmaker
board = miniworldmaker.TiledBoard()
board.add_background((255, 255, 255, 255))
board.columns = 5
board.rows = 5
board.tile_size = 40
token = miniworldmaker.Token((2,2))
@token.register
def on_clicked_left(self, position):
print("clicked" + str(position))
@token.register
def on_mouse_leave(self, position):
print("leave" + str(position))
board.run()