Forum rules - please read before posting.

Hotspots label with "Always Fit on screen" sizing question

If the "Always Fit on screen" option is enabled for the hotspots, the hotspot label is moved in a "safe" point in order to avoid that label is "cut out" of the screen.

Peeking in the code, I have found the Scripts/Menu/Menu classes/Menu.cs -> FitMenuInsideScreen function which subtracts the label rectangle width and height to the original offset in order to force the element in the screen. 
The problem is that the size considered is not dynamic, and the largest case of width is considered (which is the one I can see in the game window while previewing the hotspot menu): so an extra useless margin is added to the label in the right if the label is a short one.

See the screenshot:
image

I understand that this is because of the fixed width settings of the hotspot:
image


But if i disable the "Manual" sizing, the engine is not calculating the hotspot label size correctly and all labels are shrinked and cutted. I don't know how to fix this issue, but I have noticed that the dialogue line label works perfectly by recalculating the width dynamically using the displayed string.

image

Anyone got a workaround for this? 
Thank you for your time :) 

Comments

  • Welcome to the community, @tehpirat3.

    You're encouraged to rely on Unity UI for your Menu display, once you know the design of it - AC's built-in Menu drawing is more for prototyping at thie point.  You can switch your Hotspot Menu's Source to Unity Ui Prefab, and then link it to a Unity UI Canvas prefab in the Menu Manager.

    A tutorial on linking AC's Menu Manager to Unity UI can be found here.  A ready-made Hotspot UI can be found by copying the Demo_MenuManager's Hotspot Menu and changing its Source property to Unity Ui Prefab.

    A Unity UI-based Hotspot Menu will be dynamic in it's ability to stay within the screen boundaries, but it's dependent on the way you set up your UI canvas - basically it will keep the RectTransform boundary you define in the Menu Manager within the screen limits, so you'll need to ensure that the RectTransform boundary changes size with the contents of the Hotspot label UI Text box.
  • thank you for your quick response! Ok. I will try what you are suggesting. Thanks again!
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Welcome to the official forum for Adventure Creator.