Skip to content
Mike Yaunish edited this page Mar 21, 2024 · 1 revision

setup-style

1. Abstract

setup-style is a block of code added to any VID object style to describe how a style will be created when inserted into a layout.

2. Manual Creation

Let’s take a simple VID styled text object, like this:

style label: text "sample text"

and add a simple "setup-style" block to it

style text-root: text "sample text" extra [
    setup-style: [
        [
            input [
                prompt "Text string"
                detail "The text that will display on the object created."
            ]
            action [
                alter-facet/value 'text input-value
            ]
        ]
    ]
]

The 'setup-style' is simply a block that has been added to the extra portion of any style. This can be added and editted in place by hand, but there are tools within Direct Code to do this for you.

Let’s go through a sample creation using Direct Code first and then we can look at the components of the "setup-style" block.

3. Create setup-style using Direct Code

Insert a plain VID Object by opening the Insert Tool selecting Object and click on text. This is the source code that will be created:

    text1: text "text1"

If the setting "Auto Open VID Editor" is ON then the VID Object Editor will pop up for you automatically. If the setting is OFF, you will have to open the VID Object Editor on the object just created. Either middle mouse button click on the text just created or roll the mouse over the text and press Ctrl + ~.

Once you have the VID Object Editor open convert this VID Object to a style by selecting the following menu items: Object / Convert To Style and when asked the name of the style to create enter: "label". Which should result in the following code:

    style label: text "text1"
    text11: label
Clone this wiki locally