• Register

SFML is a portable and easy to use multimedia API written in C++. You can see it as a modern, object-oriented alternative to SDL. SFML is composed of several packages to perfectly suit your needs. You can use SFML as a minimal windowing system to interface with OpenGL, or as a fully-featured multimedia library for building games or interactive programs.

Post news Report RSS Devlog #003: Start menu with localization

Working on the start menu with localization! I'm very happy with this result and have learned a lot in the process. Next step is adding a credits button and making the options menu!

Posted by on

Start menu localization

Now that I started on the start menu, I automatically started thinking about implementing localization. I have now built a localization class that holds all translations for specific texts.

To test this I have implemented a language change and scene update whenever the "Options" button is pressed. As you can see it works just fine!
I'm very happy with this result and have learned a lot in the process.

For example I didn't know I could NOT store CJK characters inside a simple string. The characters needed for these type of words needed to be bigger, so I should either use wchar arrays or a wstring.
Luckily SFML supports entering wstrings directly into a Text, after which it will automatically render the CJK font characters as intended.

Because I use separate fonts for EFIGS and CJK, I have programmed a function that will change the used font when changing to a different language. It also changes the character sizes, because the CJK characters size 30 is much smaller than the EFIGS characters in size 30.
A great start for further localization!

Because my game will not have much text, I hope to be able to localize most text using the Polyglot game translation table. In the end I probably only have to pay for localization of my game page and achievements.

Next step is adding a credits button and making the options menu!

Post a comment

Your comment will be anonymous unless you join the community. Or sign in with your social account: