示例#1
0
文件: spaces.py 项目: savysok/diploma
def reset_block_grid():
    controller = bge.logic.getCurrentController()
    mouse_over = controller.sensors["mouse_over"]
    left_click = controller.sensors["left_click"]
    if mouse_over.positive and left_click.positive:
        clear_previous_room()
        clear_block_grid()
        create_grid_pattern(6, 6, 0, "grid_block")
示例#2
0
文件: spaces.py 项目: savysok/diploma
def room_grid(room, dimension_x, dimension_y):
    """Function that creates the grid patternt at the block editor"""
    controller = bge.logic.getCurrentController()
    mouse_over = controller.sensors["mouse_over"]
    left_click = controller.sensors["left_click"]
    if mouse_over.positive and left_click.positive:
        if distance_x != 0: 
            clear_block_grid()
            create_grid_pattern(abs(dimension_x)/2, abs(dimension_y)/2, 0, room)
示例#3
0
文件: spaces.py 项目: savysok/diploma
def reset_spaces():
    controller = bge.logic.getCurrentController()
    mouse_over = controller.sensors["mouse_over"]
    left_click = controller.sensors["left_click"]
    if mouse_over.positive and left_click.positive:
        reset_space("preview.block_bathroom", 100)
        reset_space("preview.block_bedroom", 102)
        reset_space("preview.block_kitchen", 104)
        reset_space("preview.block_livingroom", 106)
        clear_previous_room()
        clear_block_grid()
        create_grid_pattern(6, 6, 0, "grid_block")