IAppWindow#
- class omni.appwindow.IAppWindow#
Bases:
pybind11_object
Application window carb object
Methods
__init__
(*args, **kwargs)broadcast_input_blocking_state
(self, ...)Sets the forced rejecting of all input events for all device types.
focus
(self)Set the application window in focus.
Gets current action mapping set settings path.
get_clipboard
(self)Gets the text from the clipboard associated with the window.
get_cursor_blink
(self)Gets the cursor (caret) blinks state in input fields
get_dpi_scale
(self)Gets the DPI scale.
get_dpi_scale_override
(self)Gets DPI scale override.
get_event_key
(self)get_gamepad
(self, arg0)Gets the gamepads associated available.
get_height
(self)Get the window height.
get_input_blocking_state
(self, device_type)Gets whether the input for a certain device types is being blocked.
get_keyboard
(self)Gets the keyboard associated with the window.
get_mouse
(self)Gets the mouse associated with the window.
get_position
(self)Get the window position.
get_size
(self)Get the window size.
get_title
(self)Gets the window title.
get_ui_scale
(self)Gets the UI scale.
get_width
(self)Get the window width.
get_window
(self)Get the Carbonite window the editor is working with, or nullptr if headless.
Gets the event stream that fires events on window close.
Get the event stream that fires events on window DPI scale change.
Get the event stream that fires events on window drag-n-drop events.
Get the event stream that fires events on window focus change.
Get the event stream that fires events on window minimize change.
Gets the event stream that fires events on window move.
Gets the event stream that fires events on window resize.
is_focused
(self)Returns True if the application window is focused; False if not in focus.
is_fullscreen
(self)Gets the fullscreen state of editor Window.
is_maximized
(self)Gets the maxinized state of editor Window.
maximize_window
(self)Maximize the editor window.
move
(self, x, y)Move the Window.
resize
(self, width, height)Resizes the window.
restore_window
(self)Restore the editor window (exit maximize/minimize).
set_clipboard
(self, text)Sets the text in the clipboard associated with the window.
set_dpi_scale_override
(self, dpi_scale_override)Sets the DPI scale override.
set_fullscreen
(self, fullscreen)Sets fullscreen state of editor Window.
set_input_blocking_state
(self, device_type, ...)Sets the forced rejecting of all input events from a certain device type.
shutdown
(self)Deinitializes the window.
startup
(self[, name])Initializes the window taking parameters from carb::settings.
startup_with_desc
(self, title, width, height)Initializes the window with custom description.
update
(self, dt)Call one update loop iteration on application.
Attributes
Get the UI scale multiplier that is applied on top of the OS DPI scale.
- __init__(*args, **kwargs)#
- broadcast_input_blocking_state(
- self: omni.appwindow._appwindow.IAppWindow,
- should_block: bool,
Sets the forced rejecting of all input events for all device types.
- Parameters:
should_block – Whether we should block the device input or not.
- focus(self: omni.appwindow._appwindow.IAppWindow) None #
Set the application window in focus.
- get_action_mapping_set_path( ) str #
Gets current action mapping set settings path.
- Returns:
The action mapping set settings path.
- get_clipboard( ) str #
Gets the text from the clipboard associated with the window.
- Returns:
The text in the window’s clipboard.
- get_cursor_blink( ) bool #
Gets the cursor (caret) blinks state in input fields
- Returns:
True if cursor (caret) blinks in input fields.
- get_dpi_scale( ) float #
Gets the DPI scale.
- Returns:
The DPI scale.
- get_dpi_scale_override( ) float #
Gets DPI scale override.
- Returns:
DPI scale override.
- get_event_key( ) dict #
- get_gamepad(
- self: omni.appwindow._appwindow.IAppWindow,
- arg0: int,
Gets the gamepads associated available.
- Returns:
The window gamepad or nullptr if index is invalid.
- get_height( ) int #
Get the window height.
- Returns:
The window height.
- get_input_blocking_state(
- self: omni.appwindow._appwindow.IAppWindow,
- device_type: carb::input::DeviceType,
Gets whether the input for a certain device types is being blocked.
- Parameters:
device_type – The input device type, e.g. keyboard, mouse or gamepad.
- Returns:
Whether the input for a certain device types is being blocked.
- get_keyboard( ) carb::input::Keyboard #
Gets the keyboard associated with the window.
- Returns:
The window keyboard.
- get_mouse( ) carb::input::Mouse #
Gets the mouse associated with the window.
- Returns:
The window mouse.
- get_position( ) carb._carb.Int2 #
Get the window position.
- Returns:
The window position.
- get_size( ) carb._carb.Uint2 #
Get the window size.
- Returns:
The window size.
- get_title( ) str #
Gets the window title.
- Returns:
The window title.
- get_ui_scale( ) float #
Gets the UI scale. Includes UI scale multiplier and OS DPI scale.
- Returns:
UI scale. Includes UI scale multiplier and OS DPI scale.
- get_width( ) int #
Get the window width.
- Returns:
The window width.
- get_window( ) carb::windowing::Window #
Get the Carbonite window the editor is working with, or nullptr if headless.
- Returns:
Carbonite window the editor is working with, or nullptr if headless.
- get_window_close_event_stream( ) carb::events::IEventStream #
Gets the event stream that fires events on window close.
- Returns:
The event stream that fires events on window close.
- get_window_content_scale_event_stream( ) carb::events::IEventStream #
Get the event stream that fires events on window DPI scale change.
Content scale event stream provides DPI and “real DPI”. The first one is affected by the DPI override, while the second one is raw hardware DPI induced this event.
- Returns:
The event stream that fires events on window DPI scale change.
- get_window_drop_event_stream( ) carb::events::IEventStream #
Get the event stream that fires events on window drag-n-drop events.
- Returns:
The event stream that fires events on window drag-n-drop events.
- get_window_focus_event_stream( ) carb::events::IEventStream #
Get the event stream that fires events on window focus change.
- Returns:
The event stream that fires events on window focus change.
- get_window_minimize_event_stream( ) carb::events::IEventStream #
Get the event stream that fires events on window minimize change.
- Returns:
The event stream that fires events on window minimize change.
- get_window_move_event_stream( ) carb::events::IEventStream #
Gets the event stream that fires events on window move.
- Returns:
The event stream that fires events on window move.
- get_window_resize_event_stream( ) carb::events::IEventStream #
Gets the event stream that fires events on window resize.
- Returns:
The event stream that fires events on window resize.
- is_focused( ) bool #
Returns True if the application window is focused; False if not in focus.
- is_fullscreen( ) bool #
Gets the fullscreen state of editor Window.
- Returns:
True if Editor is fullscreen.
- is_maximized( ) bool #
Gets the maxinized state of editor Window.
- Returns:
True if Editor is maximized.
- maximize_window( ) None #
Maximize the editor window.
- move(
- self: omni.appwindow._appwindow.IAppWindow,
- x: int,
- y: int,
Move the Window.
- Parameters:
x – The x coordinate of the window.
y – The y coordinate of the window.
- resize(
- self: omni.appwindow._appwindow.IAppWindow,
- width: int,
- height: int,
Resizes the window. :param width: The width of the window. :param height: The height of the window.
- restore_window( ) None #
Restore the editor window (exit maximize/minimize).
- set_clipboard(
- self: omni.appwindow._appwindow.IAppWindow,
- text: str,
Sets the text in the clipboard associated with the window.
- Parameters:
text – The text in the window’s clipboard.
- set_dpi_scale_override(
- self: omni.appwindow._appwindow.IAppWindow,
- dpi_scale_override: float,
Sets the DPI scale override. Negative value means no override.
- Parameters:
dpi_scale_override – DPI scale overrides.
- set_fullscreen(
- self: omni.appwindow._appwindow.IAppWindow,
- fullscreen: bool,
Sets fullscreen state of editor Window.
- Parameters:
fullscreen – true to set Editor Window to fullscreen.
- set_input_blocking_state(
- self: omni.appwindow._appwindow.IAppWindow,
- device_type: carb::input::DeviceType,
- should_block: bool,
Sets the forced rejecting of all input events from a certain device type.
- Parameters:
device_type – The input device type, e.g. keyboard, mouse or gamepad.
should_block – Whether we should block the device input or not.
- shutdown( ) bool #
Deinitializes the window.
- Returns:
Whether the shutdown operation was completed successfully.
- startup(
- self: omni.appwindow._appwindow.IAppWindow,
- name: str = '',
Initializes the window taking parameters from carb::settings.
- Parameters:
name – Name that identifies the window, can be nullptr.
- Returns:
Whether the startup operation was completed successfully.
- startup_with_desc(
- self: omni.appwindow._appwindow.IAppWindow,
- title: str,
- width: int,
- height: int,
- x: int = 18446744073709551614,
- y: int = 18446744073709551614,
- decorations: bool = True,
- resize: bool = True,
- always_on_top: bool = False,
- scale_to_monitor: bool = True,
- dpi_scale_override: float = -1.0,
- cursor_blink: bool = True,
Initializes the window with custom description.
- Parameters:
title – the window title.
width – the window width.
height – the window height.
x – the x coordinate of the window.
y – the y coordinate of the window.
decorations – if window has full decorations.
resize – if allows window resize.
always_on_top – if the window is always on top.
scale_to_monitor – if the scale fits to the monitor size.
dpi_scale_override – DPI scale overrides.
cursor_blink – if cursor (caret) blinks in input fields or not.
- Returns:
Whether the startup operation was completed successfully.
- update(
- self: omni.appwindow._appwindow.IAppWindow,
- dt: float,
Call one update loop iteration on application.
Normally, explicitly calling update is not required, as in presence of IApp interface, a subscription will be created that will be this function automatically.
- Parameters:
dt – Time elapsed since previous call. If <0 application ignores passed value and measures elapsed time automatically
- property ui_scale_multiplier#
Get the UI scale multiplier that is applied on top of the OS DPI scale.
- Returns:
The UI scale multiplier that is applied on top of the OS DPI scale.