I'm trying to figure out why the Hotspot menu in this repro is fading out on the wrong hotspot position (happens regardless of "Update while fading out"):
https://1drv.ms/u/s!Amz_vh8OYDX3vu8YRilTSB-amwHhtw?e=H2b5Al
Issue 1:
1. hover the mouse over the Door hotspot
2. hover the mouse over an inventory item - when moving the mouse away from the button, the fade-out animation will be shown over the Door hotspot instead of over the button
Issue 2:
1. hover the mouse a "switch player button" - notice that the Hotspot menu is shown in the middle of the screen rather than on the button
2. hover over the Door hotspot
3. hover over a "switch player button" again, same as Issue 1 - when moving the mouse away from the button, the fade-out animation will be shown over the Door hotspot instead of over the button
Thanks
It looks like you're new here. If you want to get involved, click one of these buttons!
Comments
Recreated - thanks, I will look into these.
I also found an issue with Menu.PositionOffset that is easy to recreate using the same repro:
RuntimeMenu.HotspotMenu.PositionOffset = new Vector2(0, -20);
Thanks
The PositionOffset value you pass would need to be updated to reflect the changing size, as it will also need to account for the Canvas Scaler settings your UI uses.
If I understand correctly, this means I would have to do it continually as the screen size changes? Currently I only set it on the OnMenuTurnOn event.
An idea:
Since the "Auto-correct UI Dimensions" component already does the job of keeping menus in place according to the current aspect ratio, wouldn't it be perfect if that component would take the offset into account when doing it's calculation?
Thanks
That component works by adjusting the Anchor Points of the RectTransform boundary when the screen size is changed.
You could duplicate it and add a public offset to its ConvertToPlayableSpace function, but it would only be suitable for "edge" menus like the Inventory menu, that aren't otherwise repositioned (like the Hotspot menu).
Perhaps if the menus offset value is used to affect the anchor points instead? I think that would work even if the menu has an auto correct component with all its anchor points set to 0.5.
Try it with a custom variant of AutoCorrectUIDimensions - it's not referenced externally, so can be replaced without interference.
If you just wanted to offset the UI Hotspot label by a fixed amount, another option would be to just move the Text object to a child and offset the child.