Keep UIBlock/2D/3D inside screen #375
Closed
gumishima
started this conversation in
Feature Requests
Replies: 1 comment
-
Found this forum post which basically solves my issue as a whole. (NovaUI-Unity/Community#9) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I tried to make a component to keep my UI inside the screen/camera (my interface is all screenspace).
I need it because the player can move the UI elements in my game, and can easily drag them off the screen and lose it forever. I also noticed Nova has a sample for UI dragging and resizing, so users trying these can also experience losing stuff out of the screen.
When trying to make the component I had a lot of difficulty due to the CalculatedPosition() method, which whenever I tried to set the local or world position of my UI element, would override it due to the alignment of my UIBlock, due to this, making a component to modularly calculate the limits of the screen was very difficult, also due to the parent UIBlock having a different scale, world position was getting confusing, amounts were never correct somehow.
Maybe having a built-in option or component to keep things inside the screen would be awesome... Or at least would save my life, I tried for long hours and lost my sanity, but I'm also terrible at math lol.
Beta Was this translation helpful? Give feedback.
All reactions