Manages UI window positioning and visibility within a canvas boundary for runtime UI systems. More...
Public Member Functions | |
| void | Awake () |
| Initializes component references and caches frequently accessed components. | |
| void | ForceEnsureVisible () |
| Forces an immediate visibility check and repositioning if necessary. | |
| void | SetPadding (float newPadding) |
| Sets the edge padding for window boundaries. | |
| float | GetPadding () |
| Gets the current edge padding value. | |
Public Attributes | |
| GameObject | window |
| The window GameObject to be managed and positioned within canvas bounds. | |
Detailed Description
Manages UI window positioning and visibility within a canvas boundary for runtime UI systems.
The rvUIWindow component ensures that UI windows remain fully visible within the canvas bounds by automatically repositioning them when they extend beyond the viewport. This is essential for industrial HMI applications where windows must always remain accessible to operators. The component provides automatic boundary checking, smooth repositioning, and integration with the UI scaling system for responsive layouts.
Key Features:
- Automatic window repositioning to keep content within canvas bounds
- Edge padding to maintain visual separation from canvas borders
- Optimized update patterns to minimize performance impact
- Integration with rvUIScaler for responsive scaling
- Lazy initialization for efficient resource usage
Common Applications:
- Popup dialogs and context menus in HMI interfaces
- Floating tool windows and property panels
- Alert and notification windows
- Dynamic tooltip and information displays
Performance Considerations:
- Position checking occurs only once per window activation
- Cached component references minimize GetComponent calls
- World corner calculations are performed only when necessary
For detailed documentation see: https://doc.realvirtual.io/components-and-scripts/ui/ui-window
Member Function Documentation
◆ Awake()
| void realvirtual.rvUIWindow.Awake | ( | ) |
Initializes component references and caches frequently accessed components.
◆ ForceEnsureVisible()
| void realvirtual.rvUIWindow.ForceEnsureVisible | ( | ) |
Forces an immediate visibility check and repositioning if necessary.
◆ GetPadding()
| float realvirtual.rvUIWindow.GetPadding | ( | ) |
Gets the current edge padding value.
- Returns
- The current padding in pixels
◆ SetPadding()
| void realvirtual.rvUIWindow.SetPadding | ( | float | newPadding | ) |
Sets the edge padding for window boundaries.
- Parameters
-
newPadding The padding value in pixels (clamped between 0 and 100)
Member Data Documentation
◆ window
| GameObject realvirtual.rvUIWindow.window |
The window GameObject to be managed and positioned within canvas bounds.