Skip to main content

External Resource

Content List


Action External Resource Behavior

Set External Bitmap
Description

Sets ExternalResourceId and ExternalResourceManagerId properties of an associated ExternalBitmapProvider when its action is triggered.

Common Properties
Property Name Type Description
ExternalResourceId String

A unique id of an external resource to be provided.

ExternalResourceManagerId String

A unique id of an external resource manager to retrieve the external resource from.

ImageProvider ExternalBitmapProviderBehavior

External Bitmap Provider that retrieves and provides a bitmap.

Condition External Resource Behavior

Check External Resource Change
Description

Reacts on ExternalResourceEvent if and only if the ExternalResourceId and ExternalResourceManagerId of the event match the condition’s properties, triggering the associated action.

Common Properties
Property Name Type Description
ExternalResourceId String

A unique id of an external resource to be provided.

ExternalResourceManagerId String

A unique id of an external resource manager to retrieve the external resource from.

Value Processing External Resource Behavior

External Bitmap Provider
Description

Retrieves an external bitmap with ExternalResourceId from an external resource provider with ExternalResourceManagerId and provides the bitmap to an associated bitmap node.

Common Properties
Property Name Type Description
TargetNode Candera::AbstractNodePointer

The Node which is modified. If not set, then the node where the behavior is attached to, will be modified.

ExternalResourceId String

A unique id of an external resource to be provided.

ExternalResourceManagerId String

A unique id of an external resource manager to retrieve the external resource from.

 


Example Usage of External Resource Behaviors

Here is an example of the use of each External Resource behavior.

How to reference external resources

For information on referencing external resource files, see Referencing external resource. The following usage example uses an external resource that was loaded into the solution during this operation.

 

External Bitmap Provider

    Drag and drop the [ Node 2D > Bitmap Node ] from the toolbox onto the scene editor, or the scene tree.

    Attach [ Behavior > External Resource > Value Processing > External Bitmap Provider ] in the Toolbox to the Behavior in the Extra Scene Tree of the placed bitmap node by drag-and-drop operation.
    drawing-4-1686884627.png


    Click External Bitmap Provider behavior and and specify the target image file to ExternalResourceId in the properties panel that appears. ExternalResourceId can be set in the following two ways.
        Enter the resource ID directly into the ExternalResourceId text box. Press the select item button on the right side of ExternalResourceId, select the target file from the displayed dialog box, and press the [ OK ] button.
        drawing-4-1686884644.png


        The selected external resource will appear in the scene editor.
          Save the solution and launch Player to confirm that this external resource is displayed.

           

          Set External Bitmap

          1. Drag& and drop athe BitmapNode[ Node 2D > Bitmap Node ] from the "Nodestoolbox 2D"onto panelthe ofscene editor, or the scene tree.

          Attach [ Behavior > External Resource > Value Processing > External Bitmap Provider ] in the Toolbox to the Behavior in the Extra Scene EditorTree of the placed bitmap node by drag-and-drop operation.
          drawing-4-1686888365.png

          Drag and drop the [ Controls > Touchable > Button ] from the toolbox onto the scene editor, or the Scenescene Tree.tree. Take place this operation twice (add two button control nodes).

          Drag&DropAttach an[ ExternalBehavior Bitmap> Provider behavior from "External Resource > ValueAction Processing"> onSet ToolboxExternal onBitmap the BitmapNode] in the SceneTree.

          Drag&drop two Buttons from the "Control" panel of the Toolbox to the SceneActions Editor orin the Extra Scene Tree.Tree of the placed Button control nodes by drag-and-drop operation.
          drawing-4-1686888829.png


          Drag&Drop a Set External Bitmap behavior from "External Resource > Action" on Toolbox ontoSelect the ActionsButton sectionscontrol, on the Extra scene tree of each of the ButtonNodes.

          For each of the Buttons,then select the Set External Bitmap behavior.behavior Setin the "ImageProvider"Extra propertyScene totree that appears.

          Click the select item button on the ImageProvider in the properties panel that appears and select the External Bitmap Provider attachedconnected to the BitmapNode clicking(this onoperation is performed for the magnifyingtwo glassButton oncontrols).
          the
          drawing-4-1686892822.png
          right of the property.

          For each ofSelect the Buttons,Button control, then select the Set External Bitmap behavior.behavior Setin the "ExternalResourceId"Extra propertyScene totree athat specificappears.

          externalClick resourcethe byselect clickingitem button on the magnifyingExternalResourceId glass onin the rightproperties ofpanel that appears and select the property.External Bitmap Provider connected to the BitmapNode (this operation is performed for the two Button controls).
          drawing-4-1686892937.png


          Run the player and clickpress on first button (the firstplaced buttons. By pressing each button, the image isspecified displayed),in thenSet secondExternal buttonBitmap (thewill secondbe imagedisplayed. is
          displayedpicture
          drawing-4-1686892990.png
          shows up). 

           

          Check External Resource Change

          This example cannot be executed without Android studio installed.

            Drag and drop the [ Node 2D > Bitmap Node ] from the toolbox onto the scene editor, or the scene tree.

            Attach [ Behavior > External Resource > Value Processing > External Bitmap Provider
              ] Drag&drop a BitmapNode from the "Nodes 2D" panel ofin the Toolbox to the SceneBehavior Editor orin the Extra Scene Tree.Tree of the placed bitmap node by drag-and-drop operation.

              Select Scene2D in the scene tree and attach [ Behaviors > Control > Event Handler ] to the displayed extra scene tree by drag-and-drop operation.
              drawing-4-1686893159.png


              Drag&DropSelect anthe Scene2D in the scene tree, in the displayed extra scene tree, attach [ Behavior > External Resource > Condition > Check External Resource Change ] to the Condition of the Event Handler by drag-and-drop operation.
              drawing-4-1686893368.png


              Select the Scene2D in the scene tree, in the displayed extra scene tree, attach [ Behavior > External Resource > Action > Set External Bitmap Provider] to the Actions of the Event Handler by drag-and-drop operation.
              drawing-4-1686893481.png


              Select the Set External Bitmap behavior (whichyou isadded.

              aClick Valuethe Processingselect Behavior)item button on the BitmapNodeImageProvider in the SceneTree.


              properties Selectpanel that appears and select the External Bitmap Provider ofconnected to the BitmapNodeBitmapNode.
              drawing-4-1686893663.png

              Select the Set External Bitmap behavior you added.

              Click External Bitmap Provider behavior and and specify the target image file to ExternalResourceId in the properties panel that appears. ExternalResourceId can be set in the following two ways.
                Enter the resource ID directly into the ExternalResourceId text box. Press the select item button on the right side of theExternalResourceId, Scene Tree view. Setselect the "ExternalResourceId"target propertyfile usingfrom the "displayed dialog box, and press the [ OK ] button.

                Select templateCheck External Resource Change in the Event Handler.

                Click the Select Item button for item"ExternalResourceId buttonin the Properties panel that appears and select anany external imageresource fromspecified in step 9.

                Each time the "Choseimage Externaldefinition Images"is dialog. Alternatively,changed, the resourcedisplayed idimage canshould be set manually.

                The BitmapNode shows the external resource. updated.

                At this time, this event is only supported on Android systems when the user has enabled or disabled the installed RRO package.