need help for status bar

Posted: 14 Jul 2020 17:03
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?


Re: need help for status bar

Posted: 14 Jul 2020 17:52
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


Re: need help for status bar

Posted: 14 Jul 2020 19:16
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!