DAY 28 - Adding modal custom UI.
Hello!
Isn't this little modal UI pretty? Yes! Which is why I grabbed the prefab and put it into Project Dragon. I wanted Hints/Tips to pop up as a separate thing from the 'confirm' command. They didn't really need confirmation, it was more of a bigger notif for the player,
Easy enough, except when I started the game, the model UI didn't only appear when I called it. It appeared the whole time, even on the main menu. Whack!
The solution to this was fairly simple. On my new UI, I needed to make sure Visible on Awake was not ticked!
Now that tthat was out of the way, I needed to edit the prefab. The original had default text assets, but honestly they looked a little blurry. I wanted to use TextMeshPro, it's sexy, clean, and Naninovel's new default as of version 1.19.
I created TMP font assets, in the font that I wanted. Which I think was Georgia... for now. It will change once I finish the look and feel for the overall project. I followed a quick refresher for adding a new font to TextMeshPro (not hard to do at all), and got cracking.
I dragged in the Custom Variable Trigger script, and set the custom variable to "tip", as will be set in my story.
Then, to get my new modal UI to work with the command, I needed to add a dynamic string textmeshproUGUI text, onto the text object.
If you don't know how to do this, check out the calender tutorial for naninovel.
Now, I needed to test and make sure my UI and text string variable worked. I wrote a very short scenario, that would make the Hint UI popup. When it did this, the text would be blank, as nothing has been set up to the tip variable.
Then, I set the tip and showed the UI to make sure it came up. (Important to set the tip first so it already appears).
Now, everything works!












