Button Area position

All about user interface, be it customizing built-in UIs or adding new ones.
Post Reply
6degrees
Posts: 2
Joined: 22 Sep 2021 23:25

Button Area position

Post by 6degrees »

Hi,
I'm fairly new to Naninovel, so here is my question:
Let's say i would like to create an interactive area on my background image, for example a drawer.
I create an area button from my drawer background image but how can i place precisely this button over the drawer on the background image?
So far, i've tried to run the game and guess the position with the help of the script inspector but it's not easy.
Will the position of the button area will be dependent of the ratio and screen resolution of the player?
thanks for your help.

idaot
support
Posts: 262
Joined: 01 Aug 2020 08:25

Re: Button Area position

Post by idaot »

Hi,

If you want to work with a point and click type of scenario, you can do that either with a ButtonArea choice handler and a custom button for each item (if it's meant to be invisible, I suggest making it opaque first so you can position it properly and then turning the alpha down to 0). However, if you feel like creating a button for each shape/item and manually positioning becomes too tasking, then I suggest working with a Custom UI instead, where you can create and position all the buttons at once and fire events using Play Script on Unity Event components (https://naninovel.com/guide/user-interf ... nity-event). I suggest placing a background in the UI so you can use it as a reference for setting up the scene.

As for your second question, it really depends on the Unity UI settings. The reference resolution setting under Camera configuration is only for actors and it is up to you how you want to scale your UIs for different aspect ratios. You can find the Unity UI documentation here: https://docs.unity3d.com/Packages/com.u ... index.html
I also suggest studying the inbuilt Naninovel UI assets (Printers, Default UI's) which have been developed with different aspect ratios in mind and check which components they use to achieve that effect.

6degrees
Posts: 2
Joined: 22 Sep 2021 23:25

Re: Button Area position

Post by 6degrees »

Thank you very much for pointing out these solutions.
I will study the links you suggest.
This will help me to find what best suits my needs.

Post Reply