Skip to main content

Extra keys and data

Extra keys

caution

The keys you set cannot overlap with the prop's property default keys.

For instance, you can set a brand value in a prop, but you cannot set its type using this method.

You can attach extra data to the prop.

You can check the prop's extra data in prop dialog -> general tab:

new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('LIGHT').name('Brand')
.addData('brand',"I have a brand!")
.addData('light type',"hard")
.addData('color temperature',"5000")
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(0)
})
})

Exclude extra keys in general tab

You can choose to not show certain keys attached to your prop.

(However, setting extra non-display related keys to your prop is not recommended)

The following scene disables the prop's style and color temperature by including it in its excluded keys list.

new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('LIGHT').name('Brand')
.addData('brand',"I have a brand!")
.addData('light type',"hard")
.addData('color temperature',"5000")
.addExcludeKey('style', 'color temperature')
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(0)
})
})