And I can't figure out how to "script" them to change language in game.
To check if the language itself will change, I wrote a code in Start method, just like this: public void Start() { Maki.Game.Language = Maki.Languages.Get(0); }
0 - it's my ID for Polish language and it changes menu language, just like this:
When I change ID for "1" - it's English, but I can't force it to work it all on that buttons click... Maybe I'm not smart enough :D Is there a easy way to do it, maybe by schematics, or by code?
The Button component of your button can call functions of a component via it's On Click settings. So, if you have individual functions to set the languages, you can add them to the buttons.
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
On the video, I have things "outside" Makinom framework ("Options" for example) and changing language - as you can see - works fine.
But "Nowa gra" and the other options, that are set "inside" Makinom, cannot change at all.
The code itself is simple:
public void SwitchToPolish() { Maki.Game.Language = Maki.Languages.Get(1); // which is ID of PL language in Makinom }
public void SwitchToEnglish() { Maki.Game.Language = Maki.Languages.Get(0); // which is ID of EN language in Makinom }
PL button have method SwitchToPolish() and EN - SwitchToEnglish(). But it doesn't work. And the question is if I'm connecting this wrong, or can't understand how changing languages properly work for Makinom?
What kind of UI is this that's not changing? Changing the language like that should recreate HUDs to update languages, but open dialogues or menus are not affected and would need to be closed and reopened.
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
It's "UI Box with Title (TextMeshPro)" from Makinom > UI Box.
Changing the language like that should recreate HUDs to update languages, but open dialogues or menus are not affected and would need to be closed and reopened.
Yes, that's what I thought on the first time.
But could you tell me if there's a way to close that UI Box? Look on that video below: I tried to check/uncheck the visibility box and everything is set unactive, but that UI Box stays on the screen ;/ https://i.imgur.com/rq7iK3p.mp4 So I tried to do what you told -> Click on PL button, then set UI Box to unactive, but as you can see there's no way that this box will hide, I don't know why.
I assume this is the start menu? If that's the case, you can use this code to show it again (closing the current one): ORK.StartMenu.menu.Show();
Setting the UI box (or any UI game object) inactive and active again will not update it's content.
Post edited by gamingislove on
Please consider rating/reviewing my products on the Asset Store (hopefully positively), as that helps tremendously with getting found. If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Example:
https://i.imgur.com/IGYXHSd.mp4
On the video, I have things "outside" Makinom framework ("Options" for example) and changing language - as you can see - works fine.
But "Nowa gra" and the other options, that are set "inside" Makinom, cannot change at all.
The code itself is simple: PL button have method SwitchToPolish() and EN - SwitchToEnglish(). But it doesn't work. And the question is if I'm connecting this wrong, or can't understand how changing languages properly work for Makinom?
Changing the language like that should recreate HUDs to update languages, but open dialogues or menus are not affected and would need to be closed and reopened.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
But could you tell me if there's a way to close that UI Box? Look on that video below: I tried to check/uncheck the visibility box and everything is set unactive, but that UI Box stays on the screen ;/
https://i.imgur.com/rq7iK3p.mp4
So I tried to do what you told -> Click on PL button, then set UI Box to unactive, but as you can see there's no way that this box will hide, I don't know why.
If that's the case, you can use this code to show it again (closing the current one):
ORK.StartMenu.menu.Show();
Setting the UI box (or any UI game object) inactive and active again will not update it's content.
If you're enjoying my products, updates and support, please consider supporting me on patreon.com!
Thank you so so much :)!
Now the button close the menu, load ID for language and open again with proper translation :) Works like a charm.