need help for status bar

All about user interface, be it customizing built-in UIs or adding new ones.
Post Reply
drunkrobot
Posts: 17
Joined: 14 Jul 2020 16:52

need help for status bar

Post by drunkrobot »

hi i need help to draw a part of the interface of my game:

I would like to insert a status bar where I can write down the values ​​of some variables that change during the game. I am attaching a concept image

https://drive.google.com/file/d/1qmTb9T ... p=sharing

I would like to have advice if it is convenient to build a custom ui or is there an alternative?

Elringus
admin
Posts: 538
Joined: 11 May 2020 18:03

Re: need help for status bar

Post by Elringus »

Sure, a custom UI will work just fine. See the docs and video tutorials on how to add one: https://naninovel.com/guide/user-interf ... tomization

Nysalie
Posts: 29
Joined: 24 Jun 2020 20:28

Re: need help for status bar

Post by Nysalie »

I would like to add that if you intend to implement some scripting into the CustomUI (like displaying dynamic variables, ex. time or money) I think it would be better to create your own UI class that inherits from the CustomUI and apply it to your CustomUI prefab instead. You could also just attach more scripts to it but I think this way is easier to manage in the long run.

Essentially, when you create a new CustomUI (by right-click on Project folder, Create > Naninovel > CustomUI) you will be copying a prototype prefab that you can modify to implement your desired behaviour/design. If you open it, the base parent object will have a CustomUI script attached to it. You can inherit from this class on a script of your own and implement the variables there. Also, take a look at the ICustomVariableManager engine service, you will be using it to save and load your variables.

For a more practical example, the Inventory extension is great to study because it's isolated from the main framework. I also made a little calendar extension, if you want a simpler example check the CalendarUI.cs file to see what I mean about inheriting from CustomUI. Good luck!

Post Reply