Widget
- class omni.ui.scene.Widget
Bases:
Rectangle
The shape that contains the omni.ui widgets. It automatically creates IAppWindow and transfers its content to the texture of the rectangle. It interacts with the mouse and sends the mouse events to the underlying window, so interacting with the UI on this rectangle is smooth for the user.
Methods
__init__
(self, width, height, **kwargs)Created an empty image.
invalidate
(self)Rebuild and recapture the widgets at the next frame.
Attributes
Define what happens when the source image has a different size than the item.
Return the main frame of the widget.
The resolution of the widget framebuffer.
The resolution scale of the widget.
The resolution of the widget framebuffer.
Define when to redraw the widget.
- __init__(self: omni.ui_scene._scene.Widget, width: float, height: float, **kwargs) None
Created an empty image.
- `kwargsdict`
See below
### Keyword Arguments:
- `fill_policy`
Define what happens when the source image has a different size than the item.
- `update_policy`
Define when to redraw the widget.
- `resolution_scale`
The resolution scale of the widget.
- `resolution_width`
The resolution of the widget framebuffer.
- `resolution_height`
The resolution of the widget framebuffer.
- `width`
The size of the rectangle.
- `height`
The size of the rectangle.
- `thickness`
The thickness of the line.
- `intersection_thickness`
The thickness of the line for the intersection.
- `color`
The color of the line.
- `axis`
The axis the rectangle is perpendicular to.
- `wireframe`
When true, it’s a line. When false it’s a mesh.
- `gesture`
All the gestures assigned to this shape.
- `gestures`
All the gestures assigned to this shape.
- `visible`
This property holds whether the item is visible.
- class FillPolicy
Bases:
pybind11_object
Members:
STRETCH
PRESERVE_ASPECT_FIT
PRESERVE_ASPECT_CROP
- property name
- class UpdatePolicy
Bases:
pybind11_object
Members:
ON_DEMAND
ALWAYS
ON_MOUSE_HOVERED
- property name
- invalidate(self: omni.ui_scene._scene.Widget) None
Rebuild and recapture the widgets at the next frame. If frame build_fn
- property fill_policy
Define what happens when the source image has a different size than the item.
- property frame
Return the main frame of the widget.
- property resolution_height
The resolution of the widget framebuffer.
- property resolution_scale
The resolution scale of the widget.
- property resolution_width
The resolution of the widget framebuffer.
- property update_policy
Define when to redraw the widget.