Skip to main content

GettingStartedControls Part 1

This

configure the Home Scene of this solution.

The scene is built up using imported images and configuring various controls (such as TellTale, Gauge, DigitalClock, TextValue, Text, FlipBook). The use of a ForwardValue behavior will ensure that the Speed Gauge and an additional textual display will show the same value at any time.

Finally, the Panel is started to verify the coherency of the Speed Gauge and the speed's textual display.

drawing-5-1739530517.png

Setting up the SceneComposer solutionSolution

Choose

    Create a new solution using the Empty Solution template and save it as startingshown point.in
    drawing-5-1731066597.png
    Creating

    Savea thenew Solution

    .
      A new solution usingis Savecreated Solutionand As...saved.

      from File menu.
      drawing-5-1731066647.png

      Inside

      Activate the fileRender selectorTargets box create a new folder "GettingStartedControls". Please choose freely where to store this folder. Navigate into this new folder and name the solution "GettingStartedControls" and hit the Save button.
      drawing-7-1676528048.png

      You should have now the following file structure on disk:

      drawing-5-1731064385.png

      The file GettingStartedControls.scs is the main solution file and can later be loaded via "Open Solution..." from SceneComposer.

      Our GettingStartedControls solution will use a screen resolution of 1024x768 pixels. Since the default resolution settings are different we have to adapt them within the RenderTargets tabpanel on the top right ofand select [ Display (0) ]. In the SceneComposer.

      Properties
      drawing-5-1731064446.png
      panel

      Pleasebelow select "Display(0)" as can be seen above. This selection will showchange the propertiesdisplay's X and Y Resolution.

        The horizontal and vertical resolution of the selected display within the properties tab in the lower right of SceneComposer.
        drawing-5-1731064534.png

        The "X Resolution" and "Y Resolution" properties have towill be changeddefined.

        to 1024 and 768 respectively. The aspect ratio of the display will be calculated automatically.
        Target Item Setting Value X Resolution
        1024
        Y Resolution
        768
        drawing-5-1739530492.png


        You

        should now save

        Preparing the Scene

          In the Solution Explorer panel on the top left select "Scene3D" (under "Solution - Scenes") and delete it either using the <delete> key or via the context menu [ Delete ] as described in Delete a Scene.
            A "Delete Items" dialog will popup. Please resolve all dependencies with "Delete Usage Item" and click [ OK ].
              Scene3D will be deleted.
              Select "Scene2D" and rename it to "SceneHome" either by pressing <F2> on your keyboard or via the context menu "Rename".
                The scene's name has been changed to "SceneHome"
                drawing-5-1739530470.png
                In the Solution Explorer panel double-click the "SceneHome" to open it in the Scene Editor (see also 2D Scene Editor).
                  "Scene Home" will be displayed in the Scene Editor on the right of the Solution Explorer panel. The content of this scene will be displayed in the Scene Tree panel below the Solution Explorer panel.
                  Save the solution using CTRL+the <Ctrl+S> keyboard combination or byvia navigatingthe menu File - Save Solution.
                    The asterisk next to the filefilename menuin andthe selectingSceneComposer "Savewindow's Solution".titlebar will disappear, indicating that the solution has been saved.

                    Tip: It might be a good idea to make a backup of your solution now! If you destroy something during execution of the following steps you always have the possibility to restart with a clean solution. To make a copy just make a copy of the GettingStartedControls folder or create a copy by archiving into a zip file.


                    Import

                    Deletion of unused ScenesImages

                    All content that we want to display is organized into scenes. There are available scenes for 2D and 3D content. In the beginning we will only use 2D scenes to keep things a little easier. In our current solution we already have scenes of both types available. And because we don't need a 3D scene, we will delete it now.

                    The contentimages needed for this solution will be imported. Some of athem solutionwill isbe alwaysused displayedas inplain thestatic Solutionimages, Explorerbut onmost thewill top left side of SceneComposer.

                    drawing-5-1731064746.png

                    In the Solution Explorer a tree view isbe used to visualizeconfigure allcontrols.

                      In the contentmenu similarchoose [ Import ] - [ Import Resources... ] as described in How to WindowsImport FileResources. Explorer.
                      Please[ clickImport theResources small] triangledialog will be opened
                      Navigate to the leftfollowing of the Scenes folder at the bottom of the Solution Explorer.
                      drawing-5-1731064796.png

                      There are two scenes available. Pleasefolder, select theall Scene3Dfiles using your right mouse button and select "Delete"provided in thethis context"Cluster" menu. As an alternative you can select the scene with a left clickfolder and press the[ deleteOpen key from your keyboard to delete it.

                      drawing-5-1731064878.png

                      There are some dependencies to other objects, therefore SceneComposer asks us how to handle it. Please select the following settings within the dropdown menus on the right side and press OK to discard the dialog.

                      drawing-5-1731064976.png

                      You can save the solution again.


                      Creation of the first screen

                      The first screen of our GettingStartedControls application will look like this:

                      drawing-7-1676528132.png

                      In order to start easy, the screen will consist mainly of static images. Only the gauge (speedometer) and the text displaying the current speed will have real functionality behind them. At the bottom border a few tabs are shown wherein the user can later switch between different screens of the application. These tabs therefore are not static image elements but controls which are able to react on user (touch) input. The orange tab marks our current screen which is our home (cluster) screen.

                      As already mentioned, SceneComposer is using scenes to organize content which can be shown to the app user. These scenes typically contain only parts of application screens. As a cinema film is using scenes to put in order segments of a story, scenes in our context is playing a similar role. During this tutorial we will create a scene per tab content and an additional scene which contains the tab bar itself.This will help us to not repeat ourselves. If we had organized the scene exactly like the screen content we would have to use a tab bar in every screen.

                      We are now renaming the left over Scene2D into "SceneHome" to have it easier later to find our home content. Please select the Scene2D and press F2 (or use the context menu) to enter "SceneHome" as the new name.

                      drawing-5-1731066173.png

                      Please double click on the "SceneHome" to show this scene within the Scene Tree panel below the Solution Explorer.

                      drawing-5-1731066204.png

                      The scene editor will show the whole content of an opened scene. If a scene is opened its visual content is also displayed in the Scene Editor window in the center of SceneComposer. If the scene is empty you can only see a yellow border which is representing the size of the application's screen resolution. You can zoom in and out using the mouse wheel. By holding the mouse wheel and dragging you can move around the content of your view while retaining the Zoom factor. To get back to the original 100% size, please use the icon in the toolbar (Set selected camera to predefined location and orientation)].

                      drawing-5-1731066287.png

                      To be able to show some "fancy" graphics we have to import the images into our solution. We use the import images function of SceneComposer which you can find in the import menu.

                      drawing-5-1731066550.png

                      You will now be asked to save your solution. Please confirm!

                      A Windows File Explorer titled "Import Resources" will be opened. Please navigate to the Cluster folder: 

                      <cgi-studio-root>/cgi_studio_content/Resources/GettingStartedControls/Cluster

                      Select

                      all[ files provided in this Cluster folder and press the Open button.

                      The images are now processed and the "Import Images"Images ] dialog will be displayed:

                      opened
                      drawing-5-1731066491.png

                      The

                      list on top is used to show the differences of the solution before and after the import. Green means that the images are newly added to the solution. Below you can see and change the target folder of the solution where the images will be stored. Please useUse the settings as shown in the screenshot.screenshot

                      Afterand thepress import[ theOK Solution]. Explorer

                      shows the new structure:
                      drawing-5-1731066897.png

                      The images have been imported into the solution and are now ready to be used forin ourSceneHome.
                      home
                      drawing-5-1739533483.png
                      scene.

                      Drag


                      Position Images

                        In the Solution Explorer select the Bitmap "Navi60Bmp" fromand drag it into the Scene Editor.
                          The image with the curved orange arrow will be placed in the Scene Editor. It also appears in the Scene Tree panel. Select "NewWarning80Bmp" in the Solution Explorer and drag it into the Scene Editor paneltoo.
                          The
                          drawing-5-1731066943.png

                          Repeat your actionsimage with the "NewWarning80Bmp".

                          speed

                          Yourlimit scene could now look like this:

                          drawing-5-1731081663.png

                          It is now time to improve the placement of the images to make room for the speedometer. Towill be able to move the images using the mouse, change the Editor panel mode. You can find iconsplaced in the toolbarScene whichEditor.

                          offerIt thealso different Editor panel modes.
                          drawing-5-1731081779.png

                          The current mode is for selecting elementsappears in the EditorScene Tree panel.

                          It is represented byIn the blue icon. The icon marked with an orange square offers the translation mode which we need for movement of elements (translation). With the next icon you can change the scale of elements, and the icon to the right of the scale mode is used for rotation of elements. Please use now the translation mode to at least roughly arrange the elements as shown above. By the way, you can also move the entireScene Editor panel contents using the middle mouse button and then dragging the position of the content. If you have no middle mouse button you can hold CTRL and SHIFT and use the left mouse button instead.

                          To be able to place an element to a predefined position, select the element (in this case the Navi60Bmp) either using a click on the element in the editor panel or in the Scene Tree.Tree Whenpanel anselect elementthe isimages selectedindividually (suchand asmodify below)

                          their
                          Transformation
                          Position
                          X
                          and
                          drawing-7-1676528276.png

                          Its properties are shownY in the Properties panel on the lowerbottom rightright. of

                          SceneComposer. Within the Transformations Group you can find the position properties. You can enter coordinates (in pixel units) to adapt the element's position. The desired position for the Navi60Bmp is X=38 and Y=121.NewWarning80Bmp are on their final position.

                           

                          Render Node

                          Transformations
                          Position X Position Y Navi60Bmp
                          38
                          121
                          NewWarning80Bmp 38
                          612
                          drawing-5-1739538655.png
                          drawing-5-1731081999.png

                          Configure

                          Tell
                          Tale Controls

                          PleaseControls positionare image NewWarning80Bmp to X=38 and Y=612.

                          In a real application, elements will be placed using layout controls to be able to adapt to different screen sizes or culture settings. Nevertheless direct placement is often needed within layout controls or where an application designer specifies absolute placement.

                          With dragging the images directly from the Solution Explorer we used a direct method to create RenderNodes containing the dragged image. Normally we choose directly the node type within the Toolbox (top right of SceneComposer) and configure the properties in the next step.

                          Specialspecial types of nodes that already contain logic for handling of user actions (touch, click) and state changeschanges. are called Controls. YouThey can findbe these controlsfound in the Controls section on top of the Toolbox.Toolbox, which is by default located in the top right corner.

                          drawing-5-1731082113.png

                          This
                          tutorial

                          The most common control is a Button. In our home scene we used auses "TellTale"Tell ControlTale" Controls to indicate weather alerts, charging orstatus aninformation and incoming call.calls.

                          Drag
                            From the Toolbox panel in the Controls section drag and drop three3 TellTale"Tell controlsTale" Controls into the SceneEditor.Scene TellTaleEditor. controls
                            can3 beTell configuredTale Controls with twothe default images are visible in Scene Editor These 3 Tell Tale Controls also appear in the Scene Tree.
                            drawing-5-1739540253.png


                            Select the 3 "Tell Tale" Controls individually to rename each of them in the Scene Tree panel and configure their properties in the Properties panel:panel oneaccording forto the off-statetable below. Position X and one for the on-state. The imagesY can be configuredchanged by pressingin the magnifyingProperties glasspanel's icon[ nextTransformations ] section. The State property in can be changed in the [ Control ] section.
                               The properties are applied to the corresponding property.
                              drawing-5-1731082195.png

                              This will open the "Choose Item" dialog. In the left panel you can navigate to Solution > Resources > Cluster and select the correct image.

                              drawing-5-1731082931.png

                              The TellTale's state can be configured choosing between On, Off and Blinking. For the blinking option the On Time and Off Time in ms can also be set. In the image below you can see the configuration for Tell Tale_Call.

                              Tale"
                              drawing-5-1731083339.png

                              You can now configure the TellTale controls' images and positions as follows:

                              Controls.
                              NameScene State
                              Tree OnTransformations
                              State Image Off State Image PositionControl
                              Rename Node to Position X Position Y State
                              Tell Tale_Snow Off387
                              NewWeather_BBmp612 NewWeather_HBmp X=387, Y=612Off Tell Tale_Gas Off594
                              Ev_HBmp612 Ev_Bmp_HBmp X=594, Y=612Off Tell Tale_Call 800 612 Blinking Select the 3 "Tell Tale" Controls individually again to apply new OnState and OffState Images to the "TellTale" Controls in the [ Controls ] section of Properties panel according to the table below. To change "On State Image" and "Off State Image" click on the respective magnifying glass.
                                The [ Choose Item ] dialog will be opened.
                                Navigate to your desired image, select it and click [ OK ].
                                Scene Tree Control
                                Node On State Image
                                Off State Image
                                Tell Tale_Snow NewWeather_BBmp NewWeather_HBmp Tell Tale_Gas Ev_HBmp Ev_Bmp_HBmp Tell Tale_Call NewCall_HBmp NewCallBmp
                                drawing-5-1740726932.png

                                In the Scene Tree or in the Scene Editor select "Tell Tall_Call". This Tell Tale Control is configured to keep blinking. Therefore, the speed of blinking has to be configured. 
                                  The blinking interval of "Tell Tale_Call" is configured
                                  When "active rendering" is activated, this Tell Tale will be blinking in Scene Editor. "Active rendering" can be toggled using pinwheel button in the Scene Editor's bottom toolbar (see image below).
                                  X=800,Item Y=612Name On Time Ms Off Time Ms Tell Tale_Call
                                  800 800
                                  drawing-5-1739546379.png

                                  Configure a Gauge Control

                                  AnotherTo control which is used in our home scene isdisplay the "Gauge".current It is very often used for Speedometers or visualizationspeed of RPM.the car a "Gauge Control" will be used.

                                  Please

                                  useFrom the Toolbox andpanel in the Controls section drag aand drop "Gauge" controlControls into the centerScene ofEditor.
                                    A Gauge control with default images will be visible in the EditorScene panel.Editor.
                                    The Gauge Control also appears in the Scene Tree.
                                    drawing-5-1731084893.pngdrawing-5-1739545645.png

                                    In

                                    Asthe youProperties mightpanel's have[ figuredTransformations out] section configure the Gauge weControl's haveposition placed looks differentaccording to the onetable.
                                    from

                                      Gauge Control will be on it final position.
                                      Item Name
                                      Position X
                                      Position Y
                                      Gauge
                                      319

                                      217


                                      Adapt the overviewBackground atImage and Needle Image by clicking the beginning. We will now use other images for the background and needle to realize the desired look.

                                      Use the Properties panel of our Gauge to change the images and edit the values:

                                      drawing-5-1731084145.png

                                      Clickcorresponding magnifying glass toicon.
                                      the

                                      rightThe of[ theChoose backgroundItem image] todialog selectwill ourbe previouslyopened. imported ClusterBmp background image. Navigate to theyour resourcedesired directoryimage, ofselect our solutionit and selectclick [ OK ].
                                        The newly configured images will be displayed in the NewClusterBmp.Scene Editor.
                                        Item Name
                                        Background Image
                                        Needle Image
                                        Gauge
                                        NewClusterBmp NewNeedleBmp
                                        drawing-5-1731084250.png
                                        drawing-5-1739546992.png

                                        Press OK and repeat the same steps for the Needle Image selecting NewNeedleBmp.

                                        The
                                        drawing-7-1676528426.png
                                        image

                                        As you can see the needle"NewClusterBmp" needs to be repositioned in order to be in the center of the Gauge. In order to do this, click NewClusterBmp in the Solution Explorer,Explorer andselect clickNewClusterBmp. the Enable Pivot Hint checkbox inIn the Properties panel.panel's Input[ Bitmap ] section tick the valuescheckbox 194"Enable Pivot Hint" and 194 intoconfigure the XPivot andHint Yaccording fields.

                                        drawing-5-1731084741.png

                                        Doto the sametable below.

                                          After defining the Pivot Hints for NewNeedleBmp,both thisimages, time using X=112 and Y=8.
                                          drawing-5-1731084718.png

                                          Thethe needle image should nowwill be positioneddisplayed toin the center of the gauge.

                                          If no change is visible, try to forcing a screen invalidation by pressing the <F5> key.
                                          Solution Explorer
                                          Properties panel [ Bitmap ]
                                          Item Name Pivot Hint X
                                          Pivot Hint Y
                                          NewClusterBmp
                                          194 194 NewNeedleBmp
                                          112
                                          8
                                          drawing-5-1739548998.png

                                          You may need to trigger a refresh by hitting the <F5> button on your keyboard if the images' positions are not updated automatically.

                                            Configure Digital Speed Display

                                            Now,A place"Text theValue" controlControl atwill thebe centerused ofto the scene (X=319, Y=217).

                                            In the Gauge's Properties the Value property representsdisplay the current speed.speed Inputas Mindigits

                                            and
                                            Input Max isFrom the allowedToolbox rangepanel ofunder speed[ (0-300Controls km/h). The Rotation Min and Rotation Max define the start and end point of the angles used (- 45°] - 223°).[ TheCommon Internal Value Change Per Second property is used when a speed value is changed. That means in our case the needle moves up to 300 value units per second. Because the whole range is 0-300 within one second the speedometer will always be able to reach the targeted value. The Dampening Filter Constant is used to further smoothen the movement of the needle.

                                            To display the digital speed please] drag a "Text Value" control to the lowerScene middleEditor ofjust below the gaugeGauge (X=468,Control. Y=492).

                                            YouThe cancontrol findwill herebe visible in the requiredScene settings:Editor and in the Scene Tree panel.
                                             While the Text Value control is selected, adjust its position in the Properties panel's [ Transformation ] section as follows:
                                              The control will be positioned as configured.
                                              Item Name
                                              Position X
                                              Position Y
                                              Text Value 486 492

                                              In the Properties panel's [ Control ] section configure properties from the table below.

                                              drawing-5-1731085190.png

                                              The Format Text property is a template for the text using the standard printf value formatter syntax (%d for int or %03d for a 3 digit integer). The Text Value control is now positioned and configured correctly.
                                              Item Name
                                              Format Text
                                              Style
                                              Text Alignment
                                              Text Value
                                              %3d OpenSans25 Center
                                              drawing-5-1740150745.png


                                              Add 

                                              From the Toolbox panel under [ Controls ] - [ Common ] drag a text"Text" control to displaythe Scene Editor and perform the unitfollowing configurations in the Properties panel's [ Transformation ] and [ Control ] section.
                                                The Text control that displays a static text "is now positioned and configured correctly.

                                                Transformation
                                                Control Item Name
                                                Position X
                                                Position Y Text
                                                Text Style
                                                Text
                                                482 522

                                                km/h"h

                                                to positionOpenSans25 X=482, Y=522. Configuration:

                                                 

                                                drawing-5-1731085315.pngdrawing-5-1740151080.png

                                                Connect TextValue Control and Gauge Control

                                                The Text Value control will now be connected to the Gauge control, so that both controls display the same value.

                                                  Select the Gauge Control in the Scene Tree and drag and drop a "Forward Value Behavior from Toolbox -> Behaviors -> Value Processing" to the Behaviors section on the right side of the Scene Tree Panel.
                                                  The
                                                  Forward
                                                  Value
                                                  Behavior
                                                  drawing-7-1676528535.png
                                                  can
                                                  be
                                                  found
                                                  in
                                                  the

                                                  the Toolbox panel's [ Behaviors ] section under "Value Processing".

                                                    The Forward Value behavior is configured as behavior for the Gauge control.
                                                    This behavior is responsible for copying the speed value from the gaugeGauge control to the textTextValue control.

                                                    drawing-5-1740139755.png
                                                    Configure a TargetNode for the Forward Value behavior, so it knows, where it should forward the value control.to. ToIn dothe this,right Textside of the Scene Tree select the Forward Value Nodebehavior hasand to be configured ascheck the behavior'sProperties TargetNode.panel. In
                                                    order to changeClick the TargetNode, please click the corresponding magnifying glass iconnext andto choosethe TargetNode property.
                                                      The Choose Item dialog will be opened. Navigate to the Text Value Control,control, thatselect canit beand foundclick under[ ScenesOK >]. SceneHome
                                                      >The Text Value.Value control is selected as TargetNode for the Forward Value behavior.
                                                      Item Name
                                                      TargetNode Forward Value
                                                      Scenes/SceneHome/CompositeNode2D:Text Value
                                                      drawing-5-1731085506.pngdrawing-5-1740141652.png

                                                      Next, we'll add

                                                      Add a FlipBook control to the right upper corner. Drag and drop a FlipBook from the ToolBox Controls - Common to the Scene Editor with the following configuration:

                                                      drawing-5-1731085601.png

                                                      The top center of our home screen is decorated with a Digital Clock"DigitalClock" control. ThisWe will also add a "FlipBook" control canto the upper right corner of the scene. 

                                                        Drag and drop a DigitalClock control from the ToolBox (under [ Controls ] - [ Common ]) to the Scene Editor.
                                                          A DigitalClock control will be foundplaced into the scene. Configure its Position properties in the ToolBoxProperties underpanel's Controls[ -Transformation Common.] section.
                                                            The DigitalClock control will be positioned as configured.
                                                            Item Name
                                                            Position X
                                                            Position Y DigitalClock
                                                            439 116 Drag and drop a FlipBook from the ToolBox (under [ Controls ] - [ Common ]) to the Scene Editor. Place it in the upper right corner.
                                                              A FlipBook control will be placed into the scenescene. and position itConfigure toits X=439,properties Y=116.in the Properties panel's [ Transformation ] section.
                                                                The FlipBook control will be positioned as configured.
                                                                Item Name
                                                                Position X
                                                                Position Y Scale X
                                                                Scale Y
                                                                FlipBook
                                                                745 121 0.50 0.50

                                                                Check the First Scene

                                                                The first screen/scene is now finished.

                                                                You
                                                                canTo showcheck the result inof aconfiguring SceneComposerthe Displayfirst Viewscene, whichopen the display view. This view represents the final rendered result and can be opened via the view/Display/menu: View - Display - Display-00. menu.
                                                                The
                                                                display
                                                                drawing-5-1731085662.png

                                                                To be able to simulate the final application it is necessary to export the asset of the application. An asset contains only used resources from your project (controls, scenes, images, …). This asset might be stored into flash on a real embedded target. For now we generate this asset to have it available as input for our Player application (simulation driver). To generate (export) the asset you can press CTRL+G or use the File Menu and select the "Generate Asset Library…" menu entry.

                                                                drawing-5-1731086377.png

                                                                Use the Browse button to choose where the output filepanel will be stored.opened Nowin pressa floating way displaying the generatescene button. The asset will be written.

                                                                If you want to run the Player from SceneComposer, you can do so by clicking the Play buttonconfigured in the menusteps bar.

                                                                above.
                                                                drawing-5-1731086435.png
                                                                drawing-5-1740151124.png

                                                                Just

                                                                In the Toolbar make sure that the item "Generate and PlayPlay" is selected,selected in the drop-down menu and click the [ > ] button to the left.
                                                                  This will generate the asset so it is available as input for the Player. After that anthe assetCGI filePanel will be generatedstarted.
                                                                  internally,
                                                                  drawing-5-1740151171.png
                                                                  before
                                                                  running In the Player.CGI
                                                                  Panel
                                                                  select
                                                                  drawing-5-1731086481.png

                                                                  In some cases you have to choose your target device. Set the checkmark in front of the SceneHome on the middle left. You now should see the newly created scene. You can now manipulate the Gauge value for example. Please use the controls"Scenes#SceneHome" on the left halfand click on the [ Controls ] tab.

                                                                    All of the Playerscene's andcontrols setare thelisted. values as you can see above. When the Value "0,200" now is manipulated to example "0,35"Select the Gauge control.
                                                                      The Gauge control's properties are displayed in a table on the right. To check the functionality of the configured ForwardValue behavior click in the table's field of the property "Value" and manipulate its "Value" to e.g. 35.
                                                                        The Gauge's needle will adjust its rotation to display a35.
                                                                        speedThe ofTextValue 35control km/h.will also update its value to 35.
                                                                        drawing-7-1676528678.pngdrawing-5-1740151286.png