Name, NamePosition, NameOffset NameScale
Name
- If a name is not provided, a prop's name will be set to
its type + its auto-generated id
- Global Config Generator
- Config
new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('TABLE').name('I have name').addPosition((positionGenerator) => {
positionGenerator.x(50).y(50)
})
})
.addProp((generator) => {
generator.type('CAMERA').addPosition((positionGenerator) => {
positionGenerator.x(200).y(200)
})
})
config.props = [
{
"frameAnimationConfig": {
"1": {
"x": 50,
"y": 50,
}
},
"type": "TABLE",
"name": "I have name"
},
{
"frameAnimationConfig": {
"1": {
"x": 200,
"y": 200,
}
},
"type": "CAMERA"
}
]
Hide name in Viewport
- By default, the prop's name will be displayed in the viewport
You can hide it:
- Global Config Generator
- Config
new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('TABLE').name("I have name but you can't see it")
.shouldDisplayName(false).addPosition((positionGenerator) => {
positionGenerator.x(50).y(50)
})
})
.addProp((generator) => {
generator.type('TABLE').name('I have name and you can see it')
.addPosition((positionGenerator) => {
positionGenerator.x(200).y(200)
})
})
config.props = [
{
"frameAnimationConfig": {
"1": {
"x": 50,
"y": 50,
}
},
"type": "TABLE",
"name": "I have name but you can't see it",
"shouldDisplayName": false
},
{
"frameAnimationConfig": {
"1": {
"x": 200,
"y": 200,
}
},
"type": "TABLE",
"name": "I have name and you can see it"
}
]
Name Scale
- By default, name will have scale 1 in the viewport
You can scale the name:
- Global Config Generator
- Config
new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('TABLE').name('Scale 1')
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(0)
})
})
.addProp((generator) => {
generator.type('TABLE').name('Scale 0.5')
.nameScale(0.5)
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(200)
})
})
.addProp((generator) => {
generator.type('TABLE').name('Scale 2')
.nameScale(2)
.addPosition((positionGenerator) => {
positionGenerator.x(200).y(0)
})
})
config.props = [
{
"frameAnimationConfig": {
"1": {
"x": 0,
"y": 0,
}
},
"type": "TABLE",
"name": "Scale 1"
},
{
"frameAnimationConfig": {
"1": {
"x": 0,
"y": 200,
}
},
"type": "TABLE",
"name": "Scale 0.5",
"nameScale": 0.5
},
{
"frameAnimationConfig": {
"1": {
"x": 200,
"y": 0,
}
},
"type": "TABLE",
"name": "Scale 2",
"nameScale": 2
}
]
Name position in viewport
- By default, the prop's name will be displayed above the prop icon in the viewport
You can set the name position to top, left, bottom, right or center:
- Global Config Generator
- Config
new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('TABLE')
.name('top')
.namePosition('top')
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(0)
})
})
.addProp((generator) => {
generator.type('TABLE')
.name('left')
.namePosition('left')
.addPosition((positionGenerator) => {
positionGenerator.x(150).y(150)
})
})
.addProp((generator) => {
generator.type('TABLE')
.name('right')
.namePosition('right')
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(150)
})
})
.addProp((generator) => {
generator.type('TABLE')
.name('bottom')
.namePosition('bottom')
.addPosition((positionGenerator) => {
positionGenerator.x(150).y(0)
})
})
.addProp((generator) => {
generator.type('TABLE')
.name('center')
.namePosition('center')
.addPosition((positionGenerator) => {
positionGenerator.x(75).y(75)
})
})
config.props = [
{
"frameAnimationConfig": {
"1": {
"x": 0,
"y": 0,
}
},
"type": "TABLE",
"name": "top",
"namePosition": "top"
},
{
"frameAnimationConfig": {
"1": {
"x": 150,
"y": 150,
}
},
"type": "TABLE",
"name": "left",
"namePosition": "left"
},
{
"frameAnimationConfig": {
"1": {
"x": 0,
"y": 150,
}
},
"type": "TABLE",
"name": "right",
"namePosition": "right"
},
{
"frameAnimationConfig": {
"1": {
"x": 150,
"y": 0,
}
},
"type": "TABLE",
"name": "bottom",
"namePosition": "bottom"
},
{
"frameAnimationConfig": {
"1": {
"x": 150,
"y": 0,
}
},
"type": "TABLE",
"name": "center",
"namePosition": "center"
}
]
Name position offset in viewport
- By default, the prop's name will be displayed center to the prop icon
You can set the name's xOffset and yOffset:
- Global Config Generator
- Config
new GlobalConfigGenerator()
.addProp((generator) => {
generator.type('TABLE')
.name('y: -15')
.nameYOffset(-15)
.addPosition((positionGenerator) => {
positionGenerator.x(0).y(0)
})
})
.addProp((generator) => {
generator.type('TABLE')
.name('x: 50 | y: 20')
.namePosition('left')
.nameOffset(50, 20)
.addPosition((positionGenerator) => {
positionGenerator.x(150).y(150)
})
})
config.props = [
{
"frameAnimationConfig": {
"1": {
"x": 0,
"y": 0
}
},
"type": "TABLE",
"name": "y: -15",
"nameYOffset": -15,
"namePosition": "left"
},
{
"frameAnimationConfig": {
"1": {
"x": 150,
"y": 150
}
},
"type": "TABLE",
"name": "x: 50 | y: 20",
"nameXOffset": 50,
"nameYOffset": 20
}
]