Extending Storyboard Functionality

Storyboard, in its default configuration, provides enough standard functionality to satisfy most application development requirements. When additional functionality is required, there are several ways in which users can choose to extend the behavior of both Storyboard Designer and Engine.

  • Custom Lua modules provide a way to integrate access to existing C/C++ libraries. The Lua extension interface is a well documented and standard way to add new functionality to the Lua scripting environment. Storyboard includes a sample demonstrating how this integration occurs in the Lua Custom Module sample. If event based communication using Storyboard IO is not suitable for the application, then this is a preferred route for accessing external data required by the user interface.

  • The Storyboard SDK is an additional product that compliments the base Storyboard with the necessary API documentation and samples that allow users to create their own Storyboard Engine plugins. Storyboard plugins can be used to contribute new event sources, actions or render extensions. Using the Storyboard SDK one can also interact directly with the Engine's logging, performance metrics and data manager to perform various introspection activities at runtime.

User Defined Action Templates

When the Storyboard SDK is used to contribute new actions, it is desirable to have those actions available within the Storyboard Designer environment so that application designers can invoke the actions and configure their properties. To do this, an action template file describing the name and properties of the action can be created.

Action template files are added to individual projects and should be placed in the templates directory of the project and should use the file extension sbat (Storyboard Action Template)

The format of an action template file (sbat) file is as follows:

<actiontemplates> <template name="NAME"> <arguments> <element name="ARG_NAME" type="ARG_TYPE" /> ... as many elements as there are arguments ... </arguments> </template> ... as many templates as there are actions ... </actiontemplates>

Where the fields NAME, ARG_NAME and ARG_TYPE are defined as

NAME

This is the name of the action as it appears in the Storyboard Engine runtime (gapp) file.

ARG_NAME

This is the name of an argument option as it appears in the Storyboard Engine runtime (gapp) file.

ARG_TYPE

This is the type of the argument and can be one of the following:

boolean

A boolean true/false value. An optional attribute, 'default' can be used to specify the default value.

color

A color value. An optional attribute, 'default' can be used to specify the default value as a hexadecimal value (0xRRGGBB).

file

A file string. An optional 'extensions' argument list contains a list of comma separated filter file extensions, without leading dots for example extensions="gif;png;bmp"

float

A numeric floating point value. An optional attribute, 'default', can be used to specify the default value. The range of the number can also be limited using the optional 'min' and 'max' attributes

integer

A numeric integer value. An optional attribute, 'default', can be used to specify the default value. The range of the number can also be limited using the optional 'min' and 'max' attributes

string

A text string value. An optional attribute, 'default' can be used to specify the default string value.

When the template file is placed in the templates directory, the new actions will be automatically loaded into Designer the next time the project is opened.

User Defined Render Extension Templates

When the Storyboard SDK is used to contribute new render extensions, it is desirable to have those render extensions available within the Storyboard Designer environment so that application designers can use the render extensions and configure their properties. To do this, an render extension template file describing the name and properties of the render extension can be created. It is not possible to present a visual display of the render extension within Storyboard Designer so a placeholder image is presented in its place.

Render extension template files are added to individual projects and should be placed in the templates directory of the project and should use the file extension sbrt (Storyboard Render Template)

The format of a render extension template file (sbat) file is as follows:

<rendertemplates> <template name="NAME"> <arguments> <element name="ARG_NAME" type="ARG_TYPE" /> ... as many elements as there are arguments ... </arguments> </template> ... as many templates as there are actions ... </rendertemplates>

Where the fields NAME, ARG_NAME and ARG_TYPE are defined as

NAME

This is the name of the render extension as it appears in the Storyboard Engine runtime (gapp) file.

ARG_NAME

This is the name of an argument option as it appears in the Storyboard Engine runtime (gapp) file.

ARG_TYPE

This is the type of the argument and can be one of the following:

boolean

A boolean true/false value. An optional attribute, 'default' can be used to specify the default value.

color

A color value. An optional attribute, 'default' can be used to specify the default value as a hexadecimal value (0xRRGGBB).

file

A file string. An optional 'extensions' argument list contains a list of comma separated filter file extensions, without leading dots for example extensions="gif;png;bmp"

float

A numeric floating point value. An optional attribute, 'default', can be used to specify the default value. The range of the number can also be limited using the optional 'min' and 'max' attributes

integer

A numeric integer value. An optional attribute, 'default', can be used to specify the default value. The range of the number can also be limited using the optional 'min' and 'max' attributes

string

A text string value. An optional attribute, 'default' can be used to specify the default string value.

When the template file is placed in the templates directory, the new render extensions will be automatically loaded into Designer the next time the project is opened.

Was this article helpful?
0 out of 0 found this helpful