def init_graph(): """ Initialize the graph module and set default textures """ graph.initialize() # Fonts graph.set_font_folder(FONT_FOLDER) graph.set_character_space(FONT_SPACE) # Images graph.set_button_texture(graph.image(IMG_BT)) graph.set_input_texture(graph.image(IMG_INPUT)) graph.set_gear_texture(graph.image(IMG_GEAR)) # Blocks blocks.connect() graph.load_chunks() graph.set_picking_settings(PICKING_LENGTH, PICKING_STEP) # Fog graph.set_fog_distance(FOG_START, FOG_END) graph.set_fog_color(FOG_COLOR) graph.set_fog_density(FOG_DENSITY) if FOG_ENABLE: graph.enable_fog(FOG_MODE)
def load(launch_multi, launch_single, show_options): """ Load the default module """ gui.clear() # Background gui.set_background(graph.image(MENU_BACKGROUND_IMG), (MENU_BACKGROUND_SIZE)) # Title gui.add_space() gui.add_title(MENU_TITLE) gui.add_space() # Widgets gui.add_button(MENU_SINGLE, launch_single) gui.add_button(MENU_MULTI, launch_multi) gui.add_button(MENU_OPTIONS, show_options) gui.add_space() gui.add_button(MENU_EXIT, exit)
def load(go_back, connect): """ Load the multiplayer menu """ gui.clear() # Background gui.set_background(graph.image(MENU_BACKGROUND_IMG), (MENU_BACKGROUND_SIZE)) # Title gui.add_space() gui.add_title(MENU_MULTI_TITLE) gui.add_space() # Widgets gui.add_label("IP:") gui.add_input(set_ip) gui.add_button(MENU_MULTI_CONNECT, connect) gui.add_space() gui.add_space() gui.add_button(MENU_BACK, go_back)
def load(e, go_back): """ Load the menu """ gui.clear() # Background gui.set_background(graph.image(MENU_BACKGROUND_IMG), (MENU_BACKGROUND_SIZE)) # Title gui.add_space() gui.add_title(MENU_EXCEPT_TITLE) gui.add_space() # Widgets gui.add_label(MENU_EXCEPT_LBL) gui.add_label(str(e)) gui.add_space() gui.add_space() gui.add_space() gui.add_button(MENU_BACK, go_back)
def load(go_back): """ Load the multiplayer menu """ global back back = go_back gui.clear() # Background gui.set_background(graph.image(MENU_BACKGROUND_IMG), (MENU_BACKGROUND_SIZE)) # Title gui.add_space() gui.add_title(MENU_OPTIONS_TITLE) gui.add_space() # Widgets gui.add_space() gui.add_button(MENU_OPTIONS_NAME, set_name) gui.add_button(MENU_OPTIONS_PASSWORD, set_password) gui.add_space() gui.add_space() gui.add_button(MENU_BACK, go_back)
def create_cube(id, tex, type, isTransparent): """ Create a cube """ graph.register_cube(id, graph.image(BLOCKS_TEXTURE.format(tex)), type, isTransparent)