# Preparing Scenes and Views

This page covers the preparation of the foundation used throughout the subsequent pages. Starting from the Empty solution, you will set up a learning environment, configure the Render Targets, and create the basic scenes — Background, Header, MainContent, and DetailContent — along with the corresponding Views for each.

In the subsequent pages, you will use these elements to learn about screen switching with sibling Views, screen structuring with parent-child Views, and conditional transitions using the Action Chain Editor and Condition Editor.

### Preparing the solution

In this task, you prepare a learning environment free from the influence of existing samples. If unnecessary scenes or State Machines remain from the start, they can be difficult to distinguish from the structures you are about to create, so it is important to clean them up first.

<div class="page-content" dir="auto" id="bkmrk-create-a-new-solutio"><div dir="auto">

1. Create a new solution from the sample solution Empty.
2. In the Solution Explorer, delete the Scene2D and Scene3D scenes from Scenes.
3. Select Render Targets under Scenes and configure the following properties in the Properties panel:  
    <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">Render Target</td><td style="height: 29.7969px;">Auto Swap</td><td style="height: 29.7969px;">True</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;"> </td><td style="height: 29.7969px;">Auto Clear</td><td style="height: 29.7969px;">True</td></tr></tbody></table>
4. Next, delete the GlobalStateMachine from the State Machine in the Solution Explorer.
5. Save the solution with a name of your choice.

This configuration enables the system to update the display all at once after the entire Render Target finishes drawing, rather than reflecting each camera's rendering to the display individually. However, to prevent afterimages from the previous screen, the critical factor is ensuring that the Background scene (created next) correctly handles color buffer clearing.  
</div></div>### Background Scene

The purpose of this task is not simply to place a background. The Background scene plays the role of finalizing the screen's color content at the beginning of every frame. If this scene is not configured correctly, the previous screen might appear to remain visible, even though the View switch itself succeeds.

1. <span style="color: rgb(230, 126, 35);">[Create a new 2D Scene](https://doc3161en.candera.eu/books/scene-design/page/create-a-new-scene)</span> and name it **Background**.
2. Select the camera in the Scene Tree and configure the following properties in the Properties panel: <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.688px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;">Camera</td><td style="width: 199.656px;">Sequence Number</td><td style="height: 29.7969px; width: 199.688px;">0</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;"> </td><td style="width: 199.656px;">Clear Color Buffer</td><td style="height: 29.7969px; width: 199.688px;">True</td></tr><tr><td style="width: 199.656px;"> </td><td style="width: 199.656px;">Enable Swapping</td><td style="width: 199.688px;">False</td></tr></tbody></table>
3. Place a 2D Text Node from the Toolbox onto the Scene Tree of the Background scene.  
    <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px;">Transform</td><td style="width: 199.641px;">Position X</td><td style="width: 199.719px;">0</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px;"> </td><td style="width: 199.641px;">Position Y</td><td style="width: 199.719px;">0</td></tr><tr><td style="width: 199.641px;">2D Text Node</td><td style="width: 199.641px;">Text</td><td style="width: 199.719px;">Background</td></tr></tbody></table>

The Background scene requires Clear Color Buffer to be set to True. This clears the previous color content before drawing a new frame, so even when subsequent content scenes overlay their rendering with Clear Color Buffer set to False, the screen is less likely to appear doubled. Note that because the Background scene serves as both the shared background and the clearing handler, it is safer not to include screen-specific decorations in this scene.

### Header Scene

Here, you create a shared display element that multiple screens reuse. The Header is an element displayed in both MainView and DetailView, so you will later extract it as an independent View for reuse.

1. Create a new 2D Scene and name it **Header**.
2. Select the camera in the Scene Tree and configure the following properties in the Properties panel: <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.688px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;">Camera</td><td style="width: 199.656px;">Sequence Number</td><td style="height: 29.7969px; width: 199.688px;">2</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;"> </td><td style="width: 199.656px;">Clear Color Buffer</td><td style="height: 29.7969px; width: 199.688px;">False</td></tr><tr><td style="width: 199.656px;"> </td><td style="width: 199.656px;">Enable Swapping</td><td style="width: 199.688px;">False</td></tr></tbody></table>
3. Place a 2D Text Node from the Toolbox onto the Scene Tree of the Header scene. <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px;">Transform</td><td style="width: 199.641px;">Position X</td><td style="width: 199.719px;">300</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px;"> </td><td style="width: 199.641px;">Position Y</td><td style="width: 199.719px;">10</td></tr><tr><td style="width: 199.641px;">2D Text Node</td><td style="width: 199.641px;">Text</td><td style="width: 199.719px;">Common Header</td></tr></tbody></table>

The Header is a layer that simply overlays on top of the background and content. If you clear the color buffer here, you might erase previously drawn elements. By assigning a Sequence Number that places the Header in front of the background and the content, the Header achieves a natural stacking order as a heading.

### MainContent Scene

In this task, you create the main screen content used for the first screen switch. The buttons you add here serve as the entry point for building sibling View transitions in the next page.

1. Create a new 2D Scene and name it **MainContent**.
2. Select the camera in the Scene Tree and configure the following properties in the Properties panel:  
    <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.688px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;">Camera</td><td style="width: 199.656px;">Sequence Number</td><td style="height: 29.7969px; width: 199.688px;">1</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;"> </td><td style="width: 199.656px;">Clear Color Buffer</td><td style="height: 29.7969px; width: 199.688px;">False</td></tr><tr><td style="width: 199.656px;"> </td><td style="width: 199.656px;">Enable Swapping</td><td style="width: 199.688px;">False</td></tr></tbody></table>
3. Place a 2D Text Node from the Toolbox onto the Scene Tree of the MainContent scene. <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 119.188px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Transform</td><td style="width: 199.641px; height: 29.7969px;">Position X</td><td style="width: 199.719px; height: 29.7969px;">50</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;"> </td><td style="width: 199.641px; height: 29.7969px;">Position Y</td><td style="width: 199.719px; height: 29.7969px;">50</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">2D Text Node</td><td style="width: 199.641px; height: 29.7969px;">Text</td><td style="width: 199.719px; height: 29.7969px;">Main Screen</td></tr></tbody></table>
4. Next, add two TextButton controls and configure each as follows:  
    <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 119.188px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr><td colspan="3" style="width: 599.001px; background-color: rgb(194, 224, 244);">TextButton 1</td></tr><tr><td style="width: 199.641px;">General</td><td style="width: 199.641px;">Name</td><td style="width: 199.719px;">OpenDetailButton</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Transform</td><td style="width: 199.641px; height: 29.7969px;">Position X</td><td style="width: 199.719px; height: 29.7969px;">100</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;"> </td><td style="width: 199.641px; height: 29.7969px;">Position Y</td><td style="width: 199.719px; height: 29.7969px;">100</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Control</td><td style="width: 199.641px; height: 29.7969px;">Text</td><td style="width: 199.719px; height: 29.7969px;">Open Detail</td></tr><tr><td colspan="3" style="width: 599.001px; background-color: rgb(194, 224, 244);">TextButton 2</td></tr><tr><td style="width: 199.641px;">General</td><td style="width: 199.641px;">Name</td><td style="width: 199.719px;">OpenNavigationButton</td></tr><tr><td style="width: 199.641px; height: 29.7969px;">Transform</td><td style="width: 199.641px; height: 29.7969px;">Position X</td><td style="width: 199.719px; height: 29.7969px;">400</td></tr><tr><td style="width: 199.641px; height: 29.7969px;"> </td><td style="width: 199.641px; height: 29.7969px;">Position Y</td><td style="width: 199.719px; height: 29.7969px;">100</td></tr><tr><td style="width: 199.641px; height: 29.7969px;">Control</td><td style="width: 199.641px; height: 29.7969px;">Text</td><td style="width: 199.719px; height: 29.7969px;">Open Navigation</td></tr></tbody></table>

MainContent is a standard content scene placed on top of the background, so Clear Color Buffer remains set to False. The Background scene handles the clearing, and this scene only overlays the screen content on top of that background.

### DetailContent Scene

Here, you create the content for the DetailView. The Back button is used for return transitions between sibling Views, and the CheckBox is used as a control input for conditional automatic transitions in a later page.

1. Create a new 2D Scene and name it **DetailContent**.
2. Select the camera in the Scene Tree and configure the following properties in the Properties panel: <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 89.3907px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.656px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.688px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;">Camera</td><td style="width: 199.656px;">Sequence Number</td><td style="height: 29.7969px; width: 199.688px;">1</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px; width: 199.656px;"> </td><td style="width: 199.656px;">Clear Color Buffer</td><td style="height: 29.7969px; width: 199.688px;">False</td></tr><tr><td style="width: 199.656px;"> </td><td style="width: 199.656px;">Enable Swapping</td><td style="width: 199.688px;">False</td></tr></tbody></table>
3. Place a 2D Text Node from the Toolbox onto the Scene Tree of the DetailContent scene. <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 119.188px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Transform</td><td style="width: 199.641px; height: 29.7969px;">Position X</td><td style="width: 199.719px; height: 29.7969px;">50</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;"> </td><td style="width: 199.641px; height: 29.7969px;">Position Y</td><td style="width: 199.719px; height: 29.7969px;">50</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">2D Text Node</td><td style="width: 199.641px; height: 29.7969px;">Text</td><td style="width: 199.719px; height: 29.7969px;">Detail Screen</td></tr></tbody></table>
4. Next, place a TextButton control and configure the following properties: <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 148.984px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">General</td><td style="width: 199.641px; height: 29.7969px;">Name</td><td style="width: 199.719px; height: 29.7969px;">BackButton</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Transform</td><td style="width: 199.641px; height: 29.7969px;">Position X</td><td style="width: 199.719px; height: 29.7969px;">100</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;"> </td><td style="width: 199.641px; height: 29.7969px;">Position Y</td><td style="width: 199.719px; height: 29.7969px;">100</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Control</td><td style="width: 199.641px; height: 29.7969px;">Text</td><td style="width: 199.719px; height: 29.7969px;">Back</td></tr></tbody></table>
5. Finally, add a CheckBox control and configure the following properties:  
    <table border="1" style="border-collapse: collapse; width: 600px; border-width: 1px; height: 148.984px;"><tbody><tr style="height: 29.7969px;"><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Property Category</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.641px;"><span style="color: rgb(255, 255, 255);">Item</span></td><td class="align-left" style="background-color: rgb(35, 111, 161); height: 29.7969px; width: 199.719px;"><span style="color: rgb(255, 255, 255);">Value</span></td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">General</td><td style="width: 199.641px; height: 29.7969px;">Name</td><td style="width: 199.719px; height: 29.7969px;">KeepDetailOpenCheckBox</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Transform</td><td style="width: 199.641px; height: 29.7969px;">Position X</td><td style="width: 199.719px; height: 29.7969px;">100</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;"> </td><td style="width: 199.641px; height: 29.7969px;">Position Y</td><td style="width: 199.719px; height: 29.7969px;">200</td></tr><tr style="height: 29.7969px;"><td style="width: 199.641px; height: 29.7969px;">Control</td><td style="width: 199.641px; height: 29.7969px;">Text</td><td style="width: 199.719px; height: 29.7969px;">Keep Detail Open</td></tr></tbody></table>

### Configuring Scenes as Views

At this stage, you make the foundational components used in the subsequent pages referenceable as Views. When you set a Scene's IsView property to true, that Scene becomes referenceable as a View.

1. Select each of the four scenes created in the previous steps (Background / Header / MainContent / DetailContent) and select the IsView checkbox in the Scene category of the Properties panel.
    
    <div drawio-diagram="9013"><img src="https://doc3161en.candera.eu/uploads/images/drawio/2026-05/drawing-4-1779261401.png" alt=""/></div>

Because the Scene name is used as the View Identifier as is, specify the same names (Background / Header / MainContent / DetailContent) when referencing them from the View Definition Editor in the subsequent pages.

In the next page, you will combine these Views to compose MainView and DetailView, and learn how to switch between them as sibling relationships on the View Tree.