Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upGitHub is where the world builds software
Millions of developers and companies build, ship, and maintain their software on GitHub — the largest and most advanced development platform in the world.
Wrong behavior for tcod.console.Console.draw_frame with title and colors #95
Comments
|
Thanks for going through the effort to post this. Unfortunately the docs were already fixed, at least as far as being more clear on the behavior of colors. This should perform what you originally wanted to do: con.draw_frame(0, 0, 11, 5, fg=tcod.grey)
con.print_box(0, 0, 11, 1, ' test3 ', fg=tcod.grey, alignment=tcod.CENTER) |
|
I don't see it as a workaround, I see it as the correct way to draw frame titles. I don't want all libtcod games to have this single style of frame banner enforced by draw_frame. To me, it's the function limiting what a title banner can look like that's wrong, and if draw_frame didn't already take the title parameter then I'd feel no need to add it. The technical problem of draw_frame is that it draws the frame with one set of colors then draws the title with a swapped set, which absolutely breaks if either of the colors are None. It can be fixed by changing from one forced style to another or by disallowing None for the colors when a title is given. |


version 11.13.5 but it's been around for a while.
This call will produce the following (expected) result:

con.draw_frame(0, 0, 11, 5, 'test3')If I want to modify the border color (and the title color), according to the doc:
but this call produces this:

con.draw_frame(0, 0, 11, 5, 'test3', fg=tcod.grey)so if I want to get the title visible again, I either need to write above it or do the following call:

con.draw_frame(0, 0, 11, 5, 'test3', fg=tcod.grey, bg=tcod.black)which is not what I wanted, though, and neither what the doc describes.
to sum up, I believe the color of the border, which is given by fg, shouldn't be the color of the background for the title area, that should remain given by bg.