Exemplo n.º 1
0
            py = cursor.y
            ph = ybox - cursor.y + 1
        else:
            py = ybox
            ph = cursor.y - ybox + 1
        boxlist[-1] = Panel(px, py, pw, ph, border=True)


test = Console(80, 50, 'test')
test3 = Panel(0, 0, 80, 50)
test3.write(0, 0, '1234567891111111111222222222233333333334444444444' +
            '5555555555666666666677777777778')
test3.write(0, 1, '         0123456789012345678901234567890123456789' +
            '0123456789012345678901234567890')
test3.write_wrap(0, 0, 2, 50, '1 2 3 4 5 6 7 8 9 1011121314151617181' +
                 '92021222324252627282930313233343536373839404142434' +
                 '4454647484950')
cursor = Panel(0, 0, 1, 1)
cursor.write(0, 0, '@')
boxlist = []
xbox = 0
ybox = 0
working = False
mouse = libtcodpy.Mouse()
key = libtcodpy.Key()
while not test.is_window_closed:
    libtcodpy.sys_check_for_event(libtcodpy.EVENT_KEY_PRESS |
                                  libtcodpy.EVENT_MOUSE,
                                  key, mouse)
    handle_keys()
    test.clear