Skip to content

[NEW] New ttf system#115

Open
zabidenhtf wants to merge 11 commits intopetitlapin:mainfrom
zabidenhtf:newttf
Open

[NEW] New ttf system#115
zabidenhtf wants to merge 11 commits intopetitlapin:mainfrom
zabidenhtf:newttf

Conversation

@zabidenhtf
Copy link
Copy Markdown
Contributor

Yep, this is another version of my ttf system

@zabidenhtf
Copy link
Copy Markdown
Contributor Author

Also important note, this update created before music update

@petitlapin
Copy link
Copy Markdown
Owner

there are too many changes and things that went backwards on this PR, I would prefer to keep the previous one and work from it, it will be less work and headache for me. (let's keep this one open to be able to help me reporting the required changes on the other one)

@petitlapin petitlapin force-pushed the newttf branch 2 times, most recently from adae9e3 to 090410c Compare April 12, 2026 16:03
Copy link
Copy Markdown
Owner

@petitlapin petitlapin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I managed to find the time to review it :). There are still things to update but it's going in the correct direction.

Comment thread src/game.cc
DrawText(740, 340, T_lives, Sprites[fgame].Image[0]);
m_screen.ChangeFontSize(20);
m_screen.ChangeFontColor(255, 255, 0);
m_screen.PrintText("Level", 740 - m_screen.TextLength("Level") / 2, 110);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should avoid to have to repeat the text in all of the PrintText calls. I would suggest to add a enum parameter to the function: TextAlignment with 2 possible values AlignLeft and AlignCenter. If AlignLeft is set we don't do anything, if AlignCenter is set we compute the shift inside the PrintText method

Comment thread src/main.cc
SDL_LogError(SDL_LOG_CATEGORY_APPLICATION, "Unable to initialize SDL: %s", SDL_GetError());
exit(-1);
}
TTF_Init();
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we should probably call TTF_Quit at the end but for now it segfaults (probably because we call it before the destructor of Screen is called)

Comment thread src/game.cc
// When paused, asks for a key press
if (Pause) {
m_screen.PrintText(T_press_any_key, LT * D_Case / 2, 300);
m_screen.ChangeFontSize(60);
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this shadowing. I think it can potentially be used in other places so it would be better to have a method PrintShadowedText in Screen that will call internally twice the PrintText method: one for the black shadow text and one for the text with the wanted color

Comment thread src/sprite.cc

// *** Loads the languages file ***
// ********************************
if (Utils::FileExists(PathFile) == false) {
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it would be nice to display the different languages in the selection menu with texts instead of images, can you update it to use texts? Don't bother translating, you can use these texts representing the languages for now, I will fix them later:

"de_DE", "en_US", "es_ES", "fr_FR", "ar_AR", "zh_CN", "ja_JP", "ru_RU", "sl_SI", "it_IT", "br_FR", "pt_PT", "sv_SV", "eo", "hu_HU", "tr_TR", "pl_PL", "nl_NL", "ko_KR"

@zabidenhtf
Copy link
Copy Markdown
Contributor Author

https://github.com/zabidenhtf/Li-RiTransofrmedImagesIntoText

And also, i started to transform images translations into text.

@zabidenhtf
Copy link
Copy Markdown
Contributor Author

And I almost finished Ukrainian translation

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants