Skip to content
Snippets Groups Projects
scene_win.rst 3.90 KiB

Scene Window

The scene window holds a list of all graphical objects currently registered to the :class:`gfx.Scene`.

images/100208_Scene_Win.png

Every node of the graphical scene tree is shown as a subnode of the scene. It is possible to select one or more objects in the scenewin (ctrl + <left mouse> ). The available actions of the context menu are applied to all currently selected objects.

Context Menu

The Context Menu of the Scene Window is context sensitive. So, dependent on what is selected in the :class:`SceneWin` the context menu changes.

Context menu of an entity:
images/100614_entity_context_menu.png
Context menu of an entity view:
images/100614_context_menu_view.png

It is possible to extend the Context Menu from python, by creating a QAction and add it to the ContextMenu-Class. If you want to display the action only for certain objects / states, you can pass flags which marks when the action should be shown.

from PyQt5 import QtWidgets
cm = gui.GostyApp.Instance().scene_win.GetContextMenu()
action = QtWidgets.QAction("Test single entity", cm.qobject)
cm.AddAction(action, gui.ContextActionType.ENTITY | gui.ContextActionType.SINGLE)

The ContextMenu is shown whenever the user presses <right click> on the :class:`SceneWin`