def load(): """ Load the menu """ # Modules graph.set_camera_position(geometry.Vector3(16, 16, 16)) graph.set_camera_rotation(64, 0) events.connect(EVENT_MOUSE_MOVED_RELATIVE, rotate_camera) events.connect(EVENT_MOUSE_BUTTON_PRESSED, destroy_block) switch_mouse_lock() # Cursor global cursor cursor = graph.Sprite(IMG_POINTER, 32, 32) on_window_resize(window.get_size()[0], window.get_size()[1]) events.connect(EVENT_RESIZED, on_window_resize)
def init_window(): """ Create the window """ if WIN_FULLSCREEN: window.create_fullscreen() elif WIN_MAXIMIZED: window.create_maximized(WIN_TITLE) else: window.create(WIN_SIZE, WIN_TITLE) window.enable_vertical_sync(WIN_VERTICAL_SYNC) window.set_icon(WIN_ICON) if WIN_SHOW_INFOS: win_settings = window.get_settings() logger.info("Window size: {}".format(window.get_size())) logger.info("Depth bits: {}".format(win_settings[0])) logger.info("Stencil bits: {}".format(win_settings[1])) logger.info("Antialiasing level: {}".format(win_settings[2]))