-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsymbolContainer.renderer.js
73 lines (71 loc) · 2.46 KB
/
symbolContainer.renderer.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
module.exports = function(config) {
if(config.backend) {
for(const symbol of config.common.constants.SYMBOLS) {
config.backend.renderer.resources[`${symbol}-container`] = `${config.assetsUrl}${symbol}-container.svg`;
}
config.backend.renderer.metadata.symbolContainer = {
calculations: [
{
id: 'symbol',
props: ['resourceType'],
func: { $concat: [{$state: 'resourceType'}, '-container'] }
},
{
id: 'color',
props: ['resourceType'],
once: true,
func: require('./renderer.utils').colorCalc
}
],
processors: [
{
type: 'sprite',
payload: {
texture: { $calc: 'symbol' },
width: 90,
height: 90
},
},
{
type: 'sprite',
layer: 'lighting',
payload: {
texture: { $calc: 'symbol' },
width: 90,
height: 90
},
},
{
id: 'light',
type: 'sprite',
layer: 'lighting',
once: true,
payload: {
texture: 'glow',
width: 300,
height: 300,
alpha: 1,
tint: { $calc: 'color' },
},
actions: [
{
action: 'Repeat',
params: [
{
action: 'Sequence',
params: [
[
{ action: 'TintTo', params: [ 0x000000, 1 ] },
{ action: 'TintTo', params: [ { $calc: 'color' }, 1 ] }
],
],
},
],
},
],
},
],
zIndex: 4,
};
}
}