Scene trees composed of CYISceneNode objects are registered with the scene manager in order for them to be displayed to the user and so that they can receive inputs.
Scene trees are often loaded from layout files using LoadScene(), and then registered with the scene manager using AddScene(). At this point they are also staged meaning that they will be considered when the draw list is constructed during Update(). Scenes which are not staged do not receive inputs, views in those scenes may not receive focus, and those scenes will not be considered for rendering.
Loading a scene from a layout, and adding it to the scene manager:
When loading a scene certain properties of the scene must be defined. The scaling and alignment rules define how the scene adapts its designed dimensions to the dimensions at which it is being displayed. For instance, CYISceneManager::SCALE_STRETCH applied to a scene which is loaded at full-screen will naively stretch it to fit the dimensions of the display.
The return value from LoadScene() is a pointer to the root of the scene defined by the layout file provided. At this point individual elements are extracted using CYISceneNode::GetNode or CYISceneView::FindNode on the resultant scene root:
When adding a scene using AddScene() it is possible to display the scene in a sub-region of the screen. It is also possible to layer screens over top of one another by using layer indices. Scenes which are not full-screen and which are not the bottom-most layer should indicate that they are CYISceneManager::LAYER_TRANSPARENT, meaning that they can be drawn over other scenes.
Changes to focus are driven by the scene manager. The directional key events: CYIKeyEvent::YI_KEY_ARROW_UP, CYIKeyEvent::YI_KEY_ARROW_DOWN, CYIKeyEvent::YI_KEY_ARROW_LEFT, and CYIKeyEvent::YI_KEY_ARROW_RIGHT drive focus between views depending on their on-screen position and orientation. Additionally CYIEvent::YI_KEY_TAB drives focus "forward" and "reverse" depending on left to right and top-down focus order, unless otherwise specified.
CYIEvent instances are driven through the CYIApp into the CYISceneManager for redirection to the appropriate location. Events of type CYIActionEvent, which are mouse and touch events, are offered to the scene tree using their spatial coordinates. These spatial coordinates are converted from window to world space and intersected with CYISceneNode bounding boxes until a target is found. The phase at which events are moving down the tree in search of a target is referred to as the "capture" phase. The completion of a "capture" marks the "at target" phase at which the event is handled by the target node. Following this is the "bubble" phase in which all ancestors of the target node are offered the event again.
#include <scenetree/YiSceneManager.h>

Public Types | |
| enum | LAYER_TYPE { LAYER_OPAQUE, LAYER_TRANSPARENT } |
| Specifies layering rules on a scene. Transparent scenes may be drawn over other scenes. More... | |
| enum | SCALE_TYPE { SCALE_FILL, SCALE_FIT, SCALE_STRETCH, SCALE_ACTUAL_SIZE, SCALE_RESPONSIVE_LAYOUT } |
| Scaling rules define how the scene adapts to having different dimensions. More... | |
| enum | V_ALIGN_TYPE { V_ALIGN_TOP, V_ALIGN_CENTER, V_ALIGN_BOTTOM } |
| Vertical alignment. More... | |
| enum | H_ALIGN_TYPE { H_ALIGN_LEFT, H_ALIGN_CENTER, H_ALIGN_RIGHT } |
| Horizontal alignment. More... | |
| enum | MISSING_CLASS_HANDLING_MODE { ABORT, SWAP_WITH_SCENE_VIEW } |
| Optional fallback rules for missing view types during scene loading. More... | |
Public Attributes | |
| CYISignal< const CYIString &, CYISceneNode * > | SceneStaged |
| CYISignal< const CYIString &, CYISceneNode * > | SceneUnstaged |
Protected Member Functions | |
| bool | DispatchEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent, CYISceneNode *pTarget) |
| virtual bool | HandleEvent (const std::shared_ptr< CYIEventDispatcher > &pDispatcher, CYIEvent *pEvent) override |
Friends | |
| class | CYIFocusPriv |
| class | CYISceneManagerPriv |
| class | CYISceneNode |
| class | CYISceneNodeUtilityPriv |
Additional Inherited Members | |
Protected Attributes inherited from CYIEventHandler | |
| bool | m_bEnableEvents |
Horizontal alignment.
Defines how the scene will be aligned on the horizontal axis, given the CYISceneManager::SCALE_TYPE. Specified when loading a scene using LoadScene().
| Enumerator | |
|---|---|
| H_ALIGN_LEFT | |
| H_ALIGN_CENTER | |
| H_ALIGN_RIGHT | |
Specifies layering rules on a scene. Transparent scenes may be drawn over other scenes.
When adding scenes, layering instructions are provided.
Generally, the bottom-most layer should be drawn opaquely with subsequent layers drawn transparently. If multiple scenes are present on screen using sub-regions, such as in the case of a split-screen view, then the bottom-most layer in each subregion should be opaque.
| Enumerator | |
|---|---|
| LAYER_OPAQUE |
Will clear its viewport prior to rendering |
| LAYER_TRANSPARENT |
Will draw without clearing its viewport |
Optional fallback rules for missing view types during scene loading.
CYISceneView subclasses are resolved during scene import in LoadScene(). Default behaviour will assert and fail scene import if the root is a view subclass that is not able to be resolved, due to missing definitions. This provides an optional fallback to the base CYISceneView. Subviews will follow the same behavior.
| Enumerator | |
|---|---|
| ABORT | |
| SWAP_WITH_SCENE_VIEW | |
Scaling rules define how the scene adapts to having different dimensions.
Scaling rules are applied during LoadScene() and define how a screen will adapt from its designed dimensions to its target dimensions.
Vertical alignment.
Defines how the scene will be aligned on the vertical axis, given the CYISceneManager::SCALE_TYPE. Specified when loading a scene using LoadScene().
| Enumerator | |
|---|---|
| V_ALIGN_TOP | |
| V_ALIGN_CENTER | |
| V_ALIGN_BOTTOM | |
| CYISceneManager::CYISceneManager | ( | ) |
|
virtual |
| bool CYISceneManager::AddGlobalEventListener | ( | YI_EVENT_TYPE | eEventType, |
| CYIEventHandler * | pListener, | ||
| CYIEventTarget::EVENT_PHASE | ePhase = CYIEventTarget::BUBBLE |
||
| ) |
The pListener will be notified of any eEventType events occurring in the scene tree, during their ePhase, regardless of the target of the events. Returns false if the listener is null or is already registered.
| bool CYISceneManager::AddScene | ( | const CYIString & | name, |
| std::unique_ptr< CYISceneNode > | pSceneNode, | ||
| int32_t | nLayerIndex = 0, |
||
| LAYER_TYPE | eLayerType = LAYER_OPAQUE, |
||
| const CYIViewport * | pCustomViewport = nullptr |
||
| ) |
The pSceneNode, often previously loaded via LoadScene(), is registered with the scene manager with the given name and becomes eligible for rendering, input handling, and staging and unstaging.
pSceneNode must not have a parent and it must have a render target. Failure to meet these conditions results in pSceneNode being deleted and false being returned.
If other scenes have been added this scene will draw above or below them based on its nLayerIndex. A nLayerIndex of 1 will draw on top of an index of 0.
eLayerType determines whether anything will visually appear beneath the scene in layer order. Scenes which have a higher nLayerIndex must often specify CYISceneManager::LAYER_TRANSPARENT, unless they are full-screen and opaque.
The scene can be displayed in pCustomViewport which is a rectangular region specified in window coordinates, where (0,0) is the bottom-left of the window.
| bool CYISceneManager::BringToFront | ( | const CYIString & | name | ) |
The scene named name will be moved so that it is drawn overtop all of the scenes, its layer index will be equal to the current layer index of the current top-most scene.
| bool CYISceneManager::CanBeFocused | ( | const CYISceneView * | pView | ) | const |
Returns true if the given view can receive focus.
In order to receive focus a view must be reachable, have its visibility set to true, and be set to focusable.
| void CYISceneManager::ClearFocus | ( | ) |
Clears the currently focused view, if any.
| void CYISceneManager::DestroyScenes | ( | ) |
Destroys all scenes and clears the staged and un-staged collections.
|
protected |
Send an event to the specified target (and its ancestors). Applies the CYIEventTarget::CAPTURE and CYIEventTarget::BUBBLE phases.
| void CYISceneManager::Draw | ( | ) | const |
Draws the content of the scene tree.
| const CYIColor& CYISceneManager::GetBackgroundColor | ( | ) |
Returns the current background color.
| CYICameraController& CYISceneManager::GetCameraController | ( | ) |
Returns the camera controller, which is used to animate the camera dynamically to different nodes.
| CYISceneNode* CYISceneManager::GetEventCaptureRootNode | ( | ) |
Returns the node that has been set as the capture node for all events using SetEventCaptureRootNode(), or null if no node is capturing events.
| CYISceneNode* CYISceneManager::GetKeyboardCaptureNode | ( | ) | const |
Returns the node which is currently capturing all keyboard events, or null if there is no capture node.
| CYISceneNode* CYISceneManager::GetNode | ( | const CYIString & | name | ) | const |
Returns the first encountered node with name from within the staged scenes.
| CYISceneNode* CYISceneManager::GetNode | ( | const CYIString & | name, |
| const CYIRuntimeTypeInfo & | enforceClassType | ||
| ) | const |
Returns the first encountered node with name matching enforceClassType from within the staged scenes.
|
inline |
Returns the first encountered node with name matching YI_SCENE_NODE_SUBCLASS from within the staged scenes.
| CYISceneNode* CYISceneManager::GetPointerCaptureNode | ( | uint8_t | uPointerID | ) |
Returns the node that has been set as the capture node for uPointerID using SetPointerCaptureNode(), or null if no node is capturing it.
| CYISceneNode* CYISceneManager::GetScene | ( | uint32_t | uIndex | ) | const |
Returns the scene at the zero based index uIndex, or null if uIndex is greater than or equal to the number of scenes.
| CYISceneNode* CYISceneManager::GetScene | ( | const CYIString & | name | ) | const |
Returns a scene, previously added by AddScene(), with the given name, or null if it is not found.
| uint32_t CYISceneManager::GetSceneCount | ( | ) | const |
Returns the number of scenes which have been added using AddScene(), both staged and unstaged.
| bool CYISceneManager::GetSceneLayerIndex | ( | const CYIString & | name, |
| int32_t & | nLayerIndex | ||
| ) |
Retrieve the layer index of the scene node named by name. Returns false if name does not name a root scene node.
| const CYIString& CYISceneManager::GetSceneName | ( | CYISceneNode * | pScene | ) | const |
Returns the name of pScene in the scene manager. If pScene wasn't added to the scene manager returns an empty string.
| bool CYISceneManager::GetSceneProperties | ( | const CYIString & | name, |
| LAYER_TYPE & | eLayerType, | ||
| CYIViewport & | viewport | ||
| ) | const |
Retrieves the properties of a scene specified by name.
Returns false if no scene named name has been added.
The values of eLayerType and viewport are set to the properties of this scene.
| std::vector<CYISceneNode *> CYISceneManager::GetScenes | ( | ) | const |
Returns all scenes in the scene manager.
| bool CYISceneManager::GetSceneUpdateProperties | ( | CYISceneView * | pRoot, |
| SCALE_TYPE & | eScaleType, | ||
| V_ALIGN_TYPE & | eVAlign, | ||
| H_ALIGN_TYPE & | eHAlign | ||
| ) | const |
Retrieves the current scale, vertical alignment and horizontal alignment set on the scene pointed to by pRoot. Returns true if the scene's update properties have been set by a previous call to UpdateScene() or LoadScene(). Returns false if the scene's update properties have not yet been set.
| CYISceneNode* CYISceneManager::GetStagedScene | ( | uint32_t | uIndex | ) | const |
Returns the staged scene at the zero based index uIndex, or null if uIndex is greater than or equal to the number of staged scenes.
| CYISceneNode* CYISceneManager::GetStagedScene | ( | const CYIString & | name | ) | const |
Returns the staged scene matching the name provided, or null if it is not found.
| uint32_t CYISceneManager::GetStagedSceneCount | ( | ) | const |
Returns the number of scenes which have been staged using StageScene().
| std::vector<CYISceneNode *> CYISceneManager::GetStagedScenes | ( | ) | const |
Returns all of the currently staged scenes.
| CYISceneNode* CYISceneManager::GetTargetNodeAtScreenLocation | ( | int32_t | nScreenX, |
| int32_t | nScreenY | ||
| ) | const |
Returns the node located at the provided screen-space location, or null if there is no node present. The location is relative to the top-left of the screen.
| CYISceneNode* CYISceneManager::GetTrackpadCaptureNode | ( | ) | const |
Returns the node which is currently capturing all trackpad events, or null if there is no capture node.
| CYISceneNode* CYISceneManager::GetUnstagedScene | ( | uint32_t | uIndex | ) | const |
Returns the unstaged scene at the zero based index uIndex, or null if uIndex is greater than or equal to the number of unstaged scenes.
| CYISceneNode* CYISceneManager::GetUnstagedScene | ( | const CYIString & | name | ) | const |
Returns the unstaged scene matching the name provided, or null if it is not found.
| uint32_t CYISceneManager::GetUnstagedSceneCount | ( | ) | const |
Returns the number of scenes which have been added using AddScene() but have been unstaged with UnstageScene().
| std::vector<CYISceneNode *> CYISceneManager::GetUnstagedScenes | ( | ) | const |
Returns all of the currently unstaged scenes.
| CYISceneView* CYISceneManager::GetViewWithFocus | ( | ) | const |
Returns the view that currently has focus, or null if no view has focus.
| CYISceneView* CYISceneManager::GetViewWithFocus | ( | const CYISceneNode * | pRootNode | ) | const |
This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts.
Returns the view that currently has focus only if it is in the tree under and including pRootNode.
|
overrideprotectedvirtual |
Scene manager event handling. Does not bubble down to the collection of root scene nodes.
Implements CYIEventHandler.
| void CYISceneManager::HideScene | ( | const CYIString & | name | ) |
Hide a root node by name.
| void CYISceneManager::HideStagedScenes | ( | ) |
Hide all staged root scene nodes.
| std::unique_ptr<CYITimeline> CYISceneManager::ImportTimeline | ( | CYISceneNode * | pRootNode, |
| const CYIString & | filename | ||
| ) |
| bool CYISceneManager::IsReachable | ( | const CYISceneNode * | pNode | ) | const |
Returns true if this pNode is present in a staged scene.
| bool CYISceneManager::IsSceneStaged | ( | const CYIString & | name | ) | const |
Returns true if a scene with name is staged.
| bool CYISceneManager::Layout | ( | CYISceneNode * | pNode | ) |
Performs a layout pass on the scene node subtree starting at pNode. Returns true if the scene tree requires a redraw.
| std::unique_ptr<CYISceneView> CYISceneManager::LoadScene | ( | const CYIString & | filename, |
| SCALE_TYPE | scaleType = SCALE_STRETCH, |
||
| V_ALIGN_TYPE | vAlign = V_ALIGN_CENTER, |
||
| H_ALIGN_TYPE | hAlign = H_ALIGN_CENTER, |
||
| MISSING_CLASS_HANDLING_MODE | eMissingHandlingMode = ABORT |
||
| ) |
Loads a composition into the scene. Returns null in case of failure.
The layout at filename will be loaded using scaleType scaling rules and hAlign, vAlign alignment into a full-screen region. The dimensions of the fullscreen region are determined at the time of the call. On platforms where the screen dimensions can be modified such as in portrait-to-landscape orientation changes, LoadScene() must be called in the correct orientation.
eMissingHandlingMode describes an optional fallback if the root scene view has a view specialization that cannot be resolved due to missing definitions or bad assets.
| std::unique_ptr<CYISceneView> CYISceneManager::LoadScene | ( | const CYIString & | filename, |
| const YI_RECT_REL & | screenRegion, | ||
| SCALE_TYPE | scaleType = SCALE_STRETCH, |
||
| V_ALIGN_TYPE | vAlign = V_ALIGN_CENTER, |
||
| H_ALIGN_TYPE | hAlign = H_ALIGN_CENTER, |
||
| MISSING_CLASS_HANDLING_MODE | eMissingHandlingMode = ABORT |
||
| ) |
Loads a composition into the scene. Returns null in case of failure.
The layout at filename will be loaded using scaleType scaling rules and hAlign, vAlign alignment into a full-screen region. The dimensions of the fullscreen region are determined at the time of the call. On platforms where the screen dimensions can be modified such as in portrait-to-landscape orientation changes, LoadScene() must be called in the correct orientation.
eMissingHandlingMode describes an optional fallback if the root scene view has a view specialization that cannot be resolved due to missing definitions or bad assets.
The screenRegion defines the size and location of the scene to be loaded. screenRegion's origin is the bottom-left of the window.
The scene named nameToMove will be moved so that it is drawn after nameRelative, its layer index will be equal to the current layer index of nameRelative.
| bool CYISceneManager::MoveBackward | ( | const CYIString & | name | ) |
The scene named name will be moved so that it is drawn one layer below, its layer index will be equal to the layer index of the scene below which it is now drawing.
The scene named nameToMove will be moved so that it is drawn before nameRelative, its layer index will be equal to the current layer index of nameRelative.
| bool CYISceneManager::MoveFocus | ( | CYIFocus::FOCUS_DIRECTION | eDirection, |
| const CYIFocusSearchOptions & | options = CYIFocusSearchOptions() |
||
| ) |
'Moves' the focus in direction eDirection, relative to the view that currently has focus. If no view currently has focus, a focus search is started from the current focus root.
options can be used to further restrict the set of valid focus candidates.
Returns true if focus was successfully moved.
| bool CYISceneManager::MoveForward | ( | const CYIString & | name | ) |
The scene named name will be moved so that it is drawn one layer above, its layer index will be equal to the layer index of the scene above which it is now drawing.
| void CYISceneManager::OnSpecialEventTargetDestroyed | ( | CYISceneNode * | pNode | ) |
Notifies the scene manager that a special event target is being destroyed, so that it may clean up its references.
| void CYISceneManager::OnSurfaceSizeChanged | ( | ) |
Updates all scenes, updates the background, and sends a YI_EVENT_TYPE::YI_ACTION_LEAVE event to all recipients of YI_EVENT_TYPE::YI_ACTION_MOVE or YI_EVENT_TYPE::YI_ACTION_DOWN if they have not received one already.
| void CYISceneManager::QueueTimelineForPlayback | ( | CYITimeline * | pTimeline | ) |
Queues a CYITimeline object for playback on the UI thread. Calling this function on the UI thread will cause the timeline to be played back during the next draw cycle.
| bool CYISceneManager::RemoveGlobalEventListener | ( | YI_EVENT_TYPE | eEventType, |
| CYIEventHandler * | pListener, | ||
| CYIEventTarget::EVENT_PHASE | ePhase = CYIEventTarget::BUBBLE |
||
| ) |
The pListener will no longer be a global event listener. Returns false if the listener was not registered with AddGlobalEventListener().
| std::unique_ptr<CYISceneNode> CYISceneManager::RemoveScene | ( | CYISceneNode * | pSceneNode | ) |
Removes a scene which was previously added with AddScene(). Returns a null pointer if the scene has not been added.
| std::unique_ptr<CYISceneNode> CYISceneManager::RemoveScene | ( | const CYIString & | name | ) |
Removes a scene with name which was previously added with AddScene(). Returns a null pointer if no such named scene is found.
| bool CYISceneManager::RequestFocus | ( | const CYISceneView * | pViewToFocus, |
| CYIFocus::FOCUS_ROOT_RULE | eFocusRootRule = CYIFocus::FOCUS_ROOT_DESCENDANTS_UPDATE_CONTEXT |
||
| ) |
Requests that pViewToFocus receive focus. The view will receive focus if it is focusable. Returns true if pViewToFocus obtained focus or had focus before the request.
For a view to take focus, it must meet the following requirements: it is visible, attached to the tree, and focusable.
eFocusRootRule dictates whether the focus system will allow the focus request to move to a view outside of the current focus root. When CYIFocus::FOCUS_ROOT_DESCENDANTS_UPDATE_CONTEXT is provided this method will return true if pViewToFocus's focus root is updated with pViewToFocus as the current focus in that context.
pViewToFocus must be non-null. If focus needs to be cleared, ClearFocus can be used.
| bool CYISceneManager::SendToBack | ( | const CYIString & | name | ) |
The scene named name will be moved so that it is drawn behind all of the scenes, its layer index will be equal to the current layer index of the current bottom-most scene.
| void CYISceneManager::SetBackgroundColor | ( | const CYIColor & | color | ) |
Sets the solid background color which will be visible behind all scenes.
The default background color is CYIColor::Named().Black.
| void CYISceneManager::SetEventCaptureRootNode | ( | CYISceneNode * | pNode | ) |
pNode will capture all events.
| void CYISceneManager::SetKeyboardCaptureNode | ( | CYISceneNode * | pNode | ) |
pNode will receive all keyboard events. There may only be one keyboard capture node at a time. The previous node, if any, will no longer capture keyboard events.
| void CYISceneManager::SetPointerCaptureNode | ( | CYISceneNode * | pNode, |
| uint8_t | uPointerID | ||
| ) |
pNode will capture all action events from uPointerID. There may only be one pointer capture node at a time. The previous node, if any, will no longer capture pointer events.
| void CYISceneManager::SetTrackpadCaptureNode | ( | CYISceneNode * | pNode | ) |
pNode will receive all trackpad events. There may only be one trackpad capture node at a time. The previous node, if any, will no longer capture trackpad events.
| void CYISceneManager::ShowScene | ( | const CYIString & | name | ) |
Show a root node by name.
| void CYISceneManager::ShowStagedScenes | ( | ) |
Show all staged root scene nodes.
| bool CYISceneManager::StageScene | ( | const CYIString & | name | ) |
Stages a scene with name that has been registered to the scene manager with AddScene(). Staged scenes will be drawn and are eligible for inputs and focus events.
Returns false if no scene with name is registered or if the scene is already staged.
Stages a scene with name that has been registered to the scene manager with AddScene(). Staged scenes will be drawn and are eligible for inputs and focus events.
Returns false if no scene with name is registered or if the scene is already staged.
The scene named name will be staged so that it is drawn after the scene named nameRelative, its layer index will be equal to the current layer index of scene with name nameRelative.
| bool CYISceneManager::StageSceneAtBack | ( | const CYIString & | name | ) |
Stages a scene with name that has been registered to the scene manager with AddScene(). Staged scenes will be drawn and are eligible for inputs and focus events.
Returns false if no scene with name is registered or if the scene is already staged.
The scene named name will be staged so that it is drawn overtop of all of the scenes, its layer index will be equal to the current layer index of the current bottom-most scene.
| bool CYISceneManager::StageSceneAtFront | ( | const CYIString & | name | ) |
Stages a scene with name that has been registered to the scene manager with AddScene(). Staged scenes will be drawn and are eligible for inputs and focus events.
Returns false if no scene with name is registered or if the scene is already staged.
The scene named name will be staged so that it is drawn overtop of all of the scenes, its layer index will be equal to the current layer index of the current top-most scene.
Stages a scene with name that has been registered to the scene manager with AddScene(). Staged scenes will be drawn and are eligible for inputs and focus events.
Returns false if no scene with name is registered or if the scene is already staged.
The scene named name will be staged so that it is drawn before the scene named nameRelative, its layer index will be equal to the current layer index of scene with name nameRelative.
| bool CYISceneManager::UnstageScene | ( | const CYIString & | name | ) |
Unstages a scene with name that has been registered to the scene manager with AddScene(). Unstaged scenes will not be drawn and are ineligible for inputs and focus events.
Returns false if the scene is not staged.
| bool CYISceneManager::Update | ( | bool | bForceDirty, |
| bool | bForceRender = false |
||
| ) |
Drives changes to the scene tree, layouts, and focus within the scenes. Sending true for bForceDirty causes a complete update regardless of the scene tree's dirty state. Setting true for bForceRender causes a re-generation of the draw list regardless of the scene tree's dirty state.
Returns true if the scene tree requires a redraw.
| void CYISceneManager::UpdateAllScenes | ( | ) |
Updates all scenes managed by the scene manager using the current surface rectange and the scale, vertical alignment and horizontal alignment specified previously by LoadScene() or UpdateScene(). If these have not previously been called the default values of CYISceneManager::SCALE_STRETCH, CYISceneManager::V_ALIGN_CENTER and CYISceneManager::H_ALIGN_CENTER will be used.
| void CYISceneManager::UpdateBackground | ( | ) |
Updates the background for the current surface size. This can be called when the surface size changes to update the background to match the current surface without updating all scenes.
| void CYISceneManager::UpdateScene | ( | CYISceneView * | pRoot | ) |
Updates an existing scene using the current surface rectangle and the scale, vertical alignment and horizontal alignment specified previously by LoadScene or UpdateScene. If these have not previously been called the default values of CYISceneManager::SCALE_STRETCH, CYISceneManager::V_ALIGN_CENTER and CYISceneManager::H_ALIGN_CENTER will be used.
| void CYISceneManager::UpdateScene | ( | CYISceneView * | pRoot, |
| SCALE_TYPE | scaleType, | ||
| V_ALIGN_TYPE | vAlign, | ||
| H_ALIGN_TYPE | hAlign | ||
| ) |
Updates an existing scene using the current surface rectangle.
| void CYISceneManager::UpdateScene | ( | CYISceneView * | pRoot, |
| const YI_RECT_REL & | screenRegion, | ||
| SCALE_TYPE | scaleType = SCALE_STRETCH, |
||
| V_ALIGN_TYPE | vAlign = V_ALIGN_CENTER, |
||
| H_ALIGN_TYPE | hAlign = H_ALIGN_CENTER |
||
| ) |
Updates an existing scene using a custom rectangle.
| bool CYISceneManager::UpdateSceneLayerIndex | ( | const CYIString & | name, |
| int32_t | nLayerIndex | ||
| ) |
The scene named by name will be moved in the layer order to the new nLayerIndex. Returns false if name does not name a root scene node.
Layers with larger indices draw overtop of scenes with lower indices.
| bool CYISceneManager::UpdateSceneProperties | ( | const CYIString & | name, |
| LAYER_TYPE | eLayerType = LAYER_OPAQUE, |
||
| const CYIViewport * | pCustomViewport = nullptr |
||
| ) |
Updates the properties of a scene that has already been added. name specifies the name of the scene to update.
Returns false if no scene named name has been added.
| void CYISceneManager::UpdateStagedScenes | ( | ) |
Updates all staged scenes using the current surface rectange and the scale, vertical alignment and horizontal alignment specified previously by LoadScene() or UpdateScene(). If these have not previously been called the default values of CYISceneManager::SCALE_STRETCH, CYISceneManager::V_ALIGN_CENTER and CYISceneManager::H_ALIGN_CENTER will be used.
| void CYISceneManager::UpdateUnstagedScenes | ( | ) |
Updates all un-staged scenes using the current surface rectange and the scale, vertical alignment and horizontal alignment specified previously by LoadScene() or UpdateScene(). If these have not previously been called the default values of CYISceneManager::SCALE_STRETCH, CYISceneManager::V_ALIGN_CENTER and CYISceneManager::H_ALIGN_CENTER will be used.
|
friend |
|
friend |
The scene node is a friend of this class because the scene manager maintains a private queue of nodes to be deleted, which the scene node needs to access through QueueForDeletion().
|
friend |
|
friend |
| CYISignal<const CYIString &, CYISceneNode *> CYISceneManager::SceneStaged |
Emitted when a scene is staged. The first signal parameter is the scene name, and the second is the root node of the scene.
| CYISignal<const CYIString &, CYISceneNode *> CYISceneManager::SceneUnstaged |
Emitted when a scene is unstaged. The first signal parameter is the scene name, and the second is the root node of the scene.