TETRIS: Use FontConfiguration

This commit is contained in:
2021-01-30 21:35:25 +01:00
parent 73f67a3f47
commit fe675369ea
9 changed files with 73 additions and 69 deletions
+12 -3
View File
@@ -414,6 +414,12 @@ void updateSize() {
}
}
void updateBlocks() {
for ( auto &x : g_main_scene->getObjects( { BRICK_ID, SHADOW_ID } ) ) {
x->specialAction( PIECE_ACTION_UPDATE_BLOCK );
}
}
void updateColors() {
for ( auto &x : g_main_scene->getObjects( { BRICK_ID, SHADOW_ID } ) ) {
x->specialAction( PIECE_ACTION_UPDATE_COLOR );
@@ -430,9 +436,12 @@ void updateColors() {
for ( auto &x : g_main_scene->getObjects( { LINE_ID } ) ) {
x->setColor( colors["line"] );
}
for ( auto &x : g_main_scene->getObjects( { TEXT_ID } ) ) {
static_cast< SDLPP::TextRenderer * >( x.get() )->setTextColor(
g_font, colors["text"], colors["text_out"], 0.1 );
if ( g_font_config != nullptr ) {
g_font_config->setColor( colors["text"] );
g_font_config->setOutlineColor( colors["text_out"] );
for ( auto &x : g_main_scene->getObjects( { TEXT_ID } ) ) {
x->updateSizeAndPosition();
}
}
g_menu_options[g_menu_select]->setColor( colors["menu_item_background"] );
g_game_over_options[g_game_over_select]->setColor(