-
-
Notifications
You must be signed in to change notification settings - Fork 60
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Consoles are not setting the background color by default. #88
Comments
Tried using different renderers but same issue. |
I don't see anything wrong with your code example. The C++ API forwards to the C API so this issue should have been reproducible in the Python port as well, but it worked correctly when I tried it in python-tcod. Which version of libtcod are you using? Be sure to use the latest alpha release. Sample the background color after printing to make sure the issue is here: TCODConsole::root->printf(0, 0, "%ccolored%c not colored", TCOD_COLCTRL_1, TCOD_COLCTRL_STOP);
TCODColor bg = TCODConsole::root->getCharBackground(0, 0);
printf("%d,%d,%d", bg.r, bg.g, bg.b); |
I am using libtcod/1.16.0-alpha.15@hexdecimal/stable printf tells: 0,0,0 |
libtcod is built locally, as it comes as a conan source package. no warnings during build |
Thanks for the input. I think I've successfully reproduced the error in C++ and can take it from here. |
The issue was that the console background flag is unset. The default value is TCODConsole::root->setBackgroundFlag(TCOD_BKGND_SET); // Now the background colors will be set as expected.
TCODConsole::root->printf(0, 0, "%ccolored%c not colored", TCOD_COLCTRL_1, TCOD_COLCTRL_STOP); I've forgotten this was the normal behavior of libtcod. Losing track of the 'console defaults' has been a frequent issue so I wrote python-tcod to bypass these defaults completely. That is why I couldn't reproduce the issue there. This is the correct behavior of |
Thanks for your help, now it works. I think it would be a good idea to mention about it in the 'printing with color control' documentation section. |
The documentation still needs to be rewritten. The v1.6.4 docs are effectively read-only. |
Should the "Bug" label be removed from this? |
I am attempting to print colored text using 'setColorControl', the foreground is color is correctly set but not the background.
In my main loop I have:
am I doing something wrong?
The text was updated successfully, but these errors were encountered: