@combos-fun/plugin-renderer-3d-text 0.0.33 → 0.0.35

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -30,51 +30,129 @@ class Text3D extends engine.Component {
30
30
  }
31
31
  }
32
32
  tslib.__decorate([
33
- inspectorDecorator.type('string')
33
+ inspectorDecorator.Field({
34
+ type: 'string',
35
+ group: 'Text3D',
36
+ label: 'text',
37
+ description: 'Visible text content.',
38
+ editor: 'text',
39
+ })
34
40
  ], Text3D.prototype, "text", void 0);
35
41
  tslib.__decorate([
36
- inspectorDecorator.type('number'),
37
- inspectorDecorator.step(0.01)
42
+ inspectorDecorator.Field({
43
+ type: 'number',
44
+ step: 0.01,
45
+ group: 'Text3D',
46
+ label: 'fontSize',
47
+ description: 'Font size.',
48
+ editor: 'number-stepper',
49
+ })
38
50
  ], Text3D.prototype, "fontSize", void 0);
39
51
  tslib.__decorate([
40
- inspectorDecorator.type('number')
52
+ inspectorDecorator.Field({
53
+ type: 'number',
54
+ group: 'Text3D',
55
+ label: 'color',
56
+ description: 'Color value.',
57
+ editor: 'number-stepper',
58
+ })
41
59
  ], Text3D.prototype, "color", void 0);
42
60
  tslib.__decorate([
43
- inspectorDecorator.type('string')
61
+ inspectorDecorator.Field({
62
+ type: 'string',
63
+ group: 'Text3D',
64
+ label: 'anchorX',
65
+ description: 'Horizontal text anchor.',
66
+ editor: 'text',
67
+ })
44
68
  ], Text3D.prototype, "anchorX", void 0);
45
69
  tslib.__decorate([
46
- inspectorDecorator.type('string')
70
+ inspectorDecorator.Field({
71
+ type: 'string',
72
+ group: 'Text3D',
73
+ label: 'anchorY',
74
+ description: 'Vertical text anchor.',
75
+ editor: 'text',
76
+ })
47
77
  ], Text3D.prototype, "anchorY", void 0);
48
78
  tslib.__decorate([
49
- inspectorDecorator.type('number'),
50
- inspectorDecorator.step(0.1)
79
+ inspectorDecorator.Field({
80
+ type: 'number',
81
+ step: 0.1,
82
+ group: 'Text3D',
83
+ label: 'maxWidth',
84
+ description: 'Maximum text wrap width.',
85
+ editor: 'number-stepper',
86
+ })
51
87
  ], Text3D.prototype, "maxWidth", void 0);
52
88
  tslib.__decorate([
53
- inspectorDecorator.type('string')
89
+ inspectorDecorator.Field({
90
+ type: 'string',
91
+ group: 'Text3D',
92
+ label: 'font',
93
+ description: 'Font resource id.',
94
+ editor: 'text',
95
+ })
54
96
  ], Text3D.prototype, "font", void 0);
55
97
  tslib.__decorate([
56
- inspectorDecorator.type('number'),
57
- inspectorDecorator.step(0.1)
98
+ inspectorDecorator.Field({
99
+ type: 'number',
100
+ step: 0.1,
101
+ group: 'Text3D',
102
+ label: 'positionX',
103
+ description: 'Local X position.',
104
+ editor: 'number-stepper',
105
+ })
58
106
  ], Text3D.prototype, "positionX", void 0);
59
107
  tslib.__decorate([
60
- inspectorDecorator.type('number'),
61
- inspectorDecorator.step(0.1)
108
+ inspectorDecorator.Field({
109
+ type: 'number',
110
+ step: 0.1,
111
+ group: 'Text3D',
112
+ label: 'positionY',
113
+ description: 'Local Y position.',
114
+ editor: 'number-stepper',
115
+ })
62
116
  ], Text3D.prototype, "positionY", void 0);
63
117
  tslib.__decorate([
64
- inspectorDecorator.type('number'),
65
- inspectorDecorator.step(0.1)
118
+ inspectorDecorator.Field({
119
+ type: 'number',
120
+ step: 0.1,
121
+ group: 'Text3D',
122
+ label: 'positionZ',
123
+ description: 'Local Z position.',
124
+ editor: 'number-stepper',
125
+ })
66
126
  ], Text3D.prototype, "positionZ", void 0);
67
127
  tslib.__decorate([
68
- inspectorDecorator.type('number'),
69
- inspectorDecorator.step(0.01)
128
+ inspectorDecorator.Field({
129
+ type: 'number',
130
+ step: 0.01,
131
+ group: 'Text3D',
132
+ label: 'rotationX',
133
+ description: 'Rotation around X in radians.',
134
+ editor: 'number-stepper',
135
+ })
70
136
  ], Text3D.prototype, "rotationX", void 0);
71
137
  tslib.__decorate([
72
- inspectorDecorator.type('number'),
73
- inspectorDecorator.step(0.01)
138
+ inspectorDecorator.Field({
139
+ type: 'number',
140
+ step: 0.01,
141
+ group: 'Text3D',
142
+ label: 'rotationY',
143
+ description: 'Rotation around Y in radians.',
144
+ editor: 'number-stepper',
145
+ })
74
146
  ], Text3D.prototype, "rotationY", void 0);
75
147
  tslib.__decorate([
76
- inspectorDecorator.type('number'),
77
- inspectorDecorator.step(0.01)
148
+ inspectorDecorator.Field({
149
+ type: 'number',
150
+ step: 0.01,
151
+ group: 'Text3D',
152
+ label: 'rotationZ',
153
+ description: 'Rotation around Z in radians.',
154
+ editor: 'number-stepper',
155
+ })
78
156
  ], Text3D.prototype, "rotationZ", void 0);
79
157
 
80
158
  let Text3DSystem = class Text3DSystem extends pluginRenderer3d.Renderer3D {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer-3d-text.cjs.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { type, step } from '@combos-fun/inspector-decorator';\n\nexport interface Text3DParams {\n text?: string;\n fontSize?: number;\n color?: number;\n anchorX?: string;\n anchorY?: string;\n maxWidth?: number;\n font?: string;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n}\n\nexport default class Text3D extends Component<Text3DParams> {\n static componentName: string = 'Text3D';\n\n @type('string') text: string = '';\n @type('number') @step(0.01) fontSize: number = 0.5;\n @type('number') color: number = 0xffffff;\n @type('string') anchorX: string = 'center';\n @type('string') anchorY: string = 'middle';\n @type('number') @step(0.1) maxWidth: number = 0;\n @type('string') font: string = '';\n @type('number') @step(0.1) positionX: number = 0;\n @type('number') @step(0.1) positionY: number = 0;\n @type('number') @step(0.1) positionZ: number = 0;\n @type('number') @step(0.01) rotationX: number = 0;\n @type('number') @step(0.01) rotationY: number = 0;\n @type('number') @step(0.01) rotationZ: number = 0;\n\n init(obj?: Text3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport { Text as TroikaText } from 'troika-three-text';\nimport Text3D from './component';\n\n@decorators.componentObserver({\n Text3D: [\n 'text', 'fontSize', 'color', 'anchorX', 'anchorY', 'maxWidth', 'font',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n ],\n})\nexport default class Text3DSystem extends Renderer3D {\n static systemName = 'Text3DSystem';\n name: string = 'Text3DSystem';\n\n private texts: Map<number, TroikaText> = new Map();\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Text3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Text3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed.gameObject.id, changed.component as Text3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Text3D) as Text3D;\n if (!component) return;\n\n const textMesh = this.texts.get(gameObject.id);\n if (!textMesh) return;\n\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Text3D) {\n const textMesh = new TroikaText();\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n\n this.threeContext.scene.add(textMesh);\n this.texts.set(gameObject.id, textMesh);\n }\n\n private handleChange(id: number, component: Text3D) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n }\n\n private handleRemove(id: number) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.threeContext.scene.remove(textMesh);\n textMesh.dispose();\n this.texts.delete(id);\n }\n\n private syncTextProps(textMesh: TroikaText, component: Text3D) {\n textMesh.text = component.text;\n textMesh.fontSize = component.fontSize;\n textMesh.color = component.color;\n textMesh.anchorX = component.anchorX;\n textMesh.anchorY = component.anchorY;\n if (component.maxWidth > 0) {\n textMesh.maxWidth = component.maxWidth;\n }\n if (component.font) {\n textMesh.font = component.font;\n }\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n onDestroy() {\n for (const [id] of this.texts) {\n this.handleRemove(id);\n }\n this.texts.clear();\n }\n}\n"],"names":["Component","__decorate","type","step","Renderer3D","Renderer3DSystem","OBSERVER_TYPE","TroikaText","decorators"],"mappings":";;;;;;;;AAmBc,MAAO,MAAO,SAAQA,gBAAuB,CAAA;AAA3D,IAAA,WAAA,GAAA;;QAGkB,IAAA,CAAA,IAAI,GAAW,EAAE;QACL,IAAA,CAAA,QAAQ,GAAW,GAAG;QAClC,IAAA,CAAA,KAAK,GAAW,QAAQ;QACxB,IAAA,CAAA,OAAO,GAAW,QAAQ;QAC1B,IAAA,CAAA,OAAO,GAAW,QAAQ;QACf,IAAA,CAAA,QAAQ,GAAW,CAAC;QAC/B,IAAA,CAAA,IAAI,GAAW,EAAE;QACN,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACpB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;IAKnD;aAnBS,IAAA,CAAA,aAAa,GAAW,QAAX,CAAoB;AAgBxC,IAAA,IAAI,CAAC,GAAkB,EAAA;AACrB,QAAA,IAAI,GAAG;AAAE,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;IACnC;;AAhBgBC,gBAAA,CAAA;IAAfC,uBAAI,CAAC,QAAQ;AAAoB,CAAA,EA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C,YAAY,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;IACpB;;AAjFmB,YAAY,GAAAN,gBAAA,CAAA;IAPhCO,iBAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,MAAM,EAAE;YACN,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM;YACrE,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;AACtC,SAAA;KACF;AACoB,CAAA,EAAA,YAAY,CAkFhC;2BAlFoB,YAAY;;;;;"}
1
+ {"version":3,"file":"plugin-renderer-3d-text.cjs.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport interface Text3DParams {\n text?: string;\n fontSize?: number;\n color?: number;\n anchorX?: string;\n anchorY?: string;\n maxWidth?: number;\n font?: string;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n}\n\nexport default class Text3D extends Component<Text3DParams> {\n static componentName: string = 'Text3D';\n\n @Field({\n\n type: 'string',\n\n group: 'Text3D',\n\n label: 'text',\n\n description: 'Visible text content.',\n\n editor: 'text',\n\n })\n\n text: string = '';\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'fontSize',\n description: 'Font size.',\n editor: 'number-stepper',\n })\n fontSize: number = 0.5;\n @Field({\n type: 'number',\n group: 'Text3D',\n label: 'color',\n description: 'Color value.',\n editor: 'number-stepper',\n })\n color: number = 0xffffff;\n @Field({\n type: 'string',\n group: 'Text3D',\n label: 'anchorX',\n description: 'Horizontal text anchor.',\n editor: 'text',\n })\n anchorX: string = 'center';\n @Field({\n type: 'string',\n group: 'Text3D',\n label: 'anchorY',\n description: 'Vertical text anchor.',\n editor: 'text',\n })\n anchorY: string = 'middle';\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'maxWidth',\n description: 'Maximum text wrap width.',\n editor: 'number-stepper',\n })\n maxWidth: number = 0;\n @Field({\n type: 'string',\n group: 'Text3D',\n label: 'font',\n description: 'Font resource id.',\n editor: 'text',\n })\n font: string = '';\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'positionX',\n description: 'Local X position.',\n editor: 'number-stepper',\n })\n positionX: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'positionY',\n description: 'Local Y position.',\n editor: 'number-stepper',\n })\n positionY: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'positionZ',\n description: 'Local Z position.',\n editor: 'number-stepper',\n })\n positionZ: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'rotationX',\n description: 'Rotation around X in radians.',\n editor: 'number-stepper',\n })\n rotationX: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'rotationY',\n description: 'Rotation around Y in radians.',\n editor: 'number-stepper',\n })\n rotationY: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'rotationZ',\n description: 'Rotation around Z in radians.',\n editor: 'number-stepper',\n })\n rotationZ: number = 0;\n\n init(obj?: Text3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport { Text as TroikaText } from 'troika-three-text';\nimport Text3D from './component';\n\n@decorators.componentObserver({\n Text3D: [\n 'text', 'fontSize', 'color', 'anchorX', 'anchorY', 'maxWidth', 'font',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n ],\n})\nexport default class Text3DSystem extends Renderer3D {\n static systemName = 'Text3DSystem';\n name: string = 'Text3DSystem';\n\n private texts: Map<number, TroikaText> = new Map();\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Text3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Text3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed.gameObject.id, changed.component as Text3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Text3D) as Text3D;\n if (!component) return;\n\n const textMesh = this.texts.get(gameObject.id);\n if (!textMesh) return;\n\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Text3D) {\n const textMesh = new TroikaText();\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n\n this.threeContext.scene.add(textMesh);\n this.texts.set(gameObject.id, textMesh);\n }\n\n private handleChange(id: number, component: Text3D) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n }\n\n private handleRemove(id: number) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.threeContext.scene.remove(textMesh);\n textMesh.dispose();\n this.texts.delete(id);\n }\n\n private syncTextProps(textMesh: TroikaText, component: Text3D) {\n textMesh.text = component.text;\n textMesh.fontSize = component.fontSize;\n textMesh.color = component.color;\n textMesh.anchorX = component.anchorX;\n textMesh.anchorY = component.anchorY;\n if (component.maxWidth > 0) {\n textMesh.maxWidth = component.maxWidth;\n }\n if (component.font) {\n textMesh.font = component.font;\n }\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n onDestroy() {\n for (const [id] of this.texts) {\n this.hand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QAAA,IAAI,SAAS,CAAC,IAAI,EAAE;AAClB,YAAA,QAAQ,CAAC,IAAI,GAAG,SAAS,CAAC,IAAI;QAChC;AACA,QAAA,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC;AACpF,QAAA,QAAQ,CAAC,QAAQ,CAAC,GAAG,CAAC,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,EAAE,SAAS,CAAC,SAAS,CAAC;IACtF;IAEA,SAAS,GAAA;QACP,KAAK,MAAM,CAAC,EAAE,CAAC,IAAI,IAAI,CAAC,KAAK,EAAE;AAC7B,YAAA,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;IACpB;;AAjFmB,YAAY,GAAAL,gBAAA,CAAA;IAPhCM,iBAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,MAAM,EAAE;YACN,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM;YACrE,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;AACtC,SAAA;KACF;AACoB,CAAA,EAAA,YAAY,CAkFhC;2BAlFoB,YAAY;;;;;"}
@@ -1 +1 @@
1
- "use strict";var t=require("tslib"),e=require("@combos-fun/engine"),o=require("@combos-fun/inspector-decorator"),i=require("@combos-fun/plugin-renderer-3d"),n=require("troika-three-text");class r extends e.Component{constructor(){super(...arguments),this.text="",this.fontSize=.5,this.color=16777215,this.anchorX="center",this.anchorY="middle",this.maxWidth=0,this.font="",this.positionX=0,this.positionY=0,this.positionZ=0,this.rotationX=0,this.rotationY=0,this.rotationZ=0}static{this.componentName="Text3D"}init(t){t&&Object.assign(this,t)}}t.__decorate([o.type("string")],r.prototype,"text",void 0),t.__decorate([o.type("number"),o.step(.01)],r.prototype,"fontSize",void 0),t.__decorate([o.type("number")],r.prototype,"color",void 0),t.__decorate([o.type("string")],r.prototype,"anchorX",void 0),t.__decorate([o.type("string")],r.prototype,"anchorY",void 0),t.__decorate([o.type("number"),o.step(.1)],r.prototype,"maxWidth",void 0),t.__decorate([o.type("string")],r.prototype,"font",void 0),t.__decorate([o.type("number"),o.step(.1)],r.prototype,"positionX",void 0),t.__decorate([o.type("number"),o.step(.1)],r.prototype,"positionY",void 0),t.__decorate([o.type("number"),o.step(.1)],r.prototype,"positionZ",void 0),t.__decorate([o.type("number"),o.step(.01)],r.prototype,"rotationX",void 0),t.__decorate([o.type("number"),o.step(.01)],r.prototype,"rotationY",void 0),t.__decorate([o.type("number"),o.step(.01)],r.prototype,"rotationZ",void 0);let s=class extends i.Renderer3D{constructor(){super(...arguments),this.name="Text3DSystem",this.texts=new Map}static{this.systemName="Text3DSystem"}init(){this.game.getSystem(i.Renderer3DSystem).rendererManager.register(this)}componentChanged(t){"Text3D"===t.componentName&&(t.type===e.OBSERVER_TYPE.ADD?this.handleAdd(t.gameObject,t.component):t.type===e.OBSERVER_TYPE.REMOVE?this.handleRemove(t.gameObject.id):this.handleChange(t.gameObject.id,t.component))}rendererUpdate(t){const e=t.getComponent(r);if(!e)return;const o=this.texts.get(t.id);o&&(o.position.set(e.positionX,e.positionY,e.positionZ),o.rotation.set(e.rotationX,e.rotationY,e.rotationZ))}handleAdd(t,e){const o=new n.Text;this.syncTextProps(o,e),o.sync(),this.threeContext.scene.add(o),this.texts.set(t.id,o)}handleChange(t,e){const o=this.texts.get(t);o&&(this.syncTextProps(o,e),o.sync())}handleRemove(t){const e=this.texts.get(t);e&&(this.threeContext.scene.remove(e),e.dispose(),this.texts.delete(t))}syncTextProps(t,e){t.text=e.text,t.fontSize=e.fontSize,t.color=e.color,t.anchorX=e.anchorX,t.anchorY=e.anchorY,e.maxWidth>0&&(t.maxWidth=e.maxWidth),e.font&&(t.font=e.font),t.position.set(e.positionX,e.positionY,e.positionZ),t.rotation.set(e.rotationX,e.rotationY,e.rotationZ)}onDestroy(){for(const[t]of this.texts)this.handleRemove(t);this.texts.clear()}};s=t.__decorate([e.decorators.componentObserver({Text3D:["text","fontSize","color","anchorX","anchorY","maxWidth","font","positionX","positionY","positionZ","rotationX","rotationY","rotationZ"]})],s);var p=s;exports.Text3D=r,exports.Text3DSystem=p;
1
+ "use strict";var t=require("tslib"),e=require("@combos-fun/engine"),o=require("@combos-fun/inspector-decorator"),i=require("@combos-fun/plugin-renderer-3d"),r=require("troika-three-text");class n extends e.Component{constructor(){super(...arguments),this.text="",this.fontSize=.5,this.color=16777215,this.anchorX="center",this.anchorY="middle",this.maxWidth=0,this.font="",this.positionX=0,this.positionY=0,this.positionZ=0,this.rotationX=0,this.rotationY=0,this.rotationZ=0}static{this.componentName="Text3D"}init(t){t&&Object.assign(this,t)}}t.__decorate([o.Field({type:"string",group:"Text3D",label:"text",description:"Visible text content.",editor:"text"})],n.prototype,"text",void 0),t.__decorate([o.Field({type:"number",step:.01,group:"Text3D",label:"fontSize",description:"Font size.",editor:"number-stepper"})],n.prototype,"fontSize",void 0),t.__decorate([o.Field({type:"number",group:"Text3D",label:"color",description:"Color value.",editor:"number-stepper"})],n.prototype,"color",void 0),t.__decorate([o.Field({type:"string",group:"Text3D",label:"anchorX",description:"Horizontal text anchor.",editor:"text"})],n.prototype,"anchorX",void 0),t.__decorate([o.Field({type:"string",group:"Text3D",label:"anchorY",description:"Vertical text anchor.",editor:"text"})],n.prototype,"anchorY",void 0),t.__decorate([o.Field({type:"number",step:.1,group:"Text3D",label:"maxWidth",description:"Maximum text wrap width.",editor:"number-stepper"})],n.prototype,"maxWidth",void 0),t.__decorate([o.Field({type:"string",group:"Text3D",label:"font",description:"Font resource id.",editor:"text"})],n.prototype,"font",void 0),t.__decorate([o.Field({type:"number",step:.1,group:"Text3D",label:"positionX",description:"Local X position.",editor:"number-stepper"})],n.prototype,"positionX",void 0),t.__decorate([o.Field({type:"number",step:.1,group:"Text3D",label:"positionY",description:"Local Y position.",editor:"number-stepper"})],n.prototype,"positionY",void 0),t.__decorate([o.Field({type:"number",step:.1,group:"Text3D",label:"positionZ",description:"Local Z position.",editor:"number-stepper"})],n.prototype,"positionZ",void 0),t.__decorate([o.Field({type:"number",step:.01,group:"Text3D",label:"rotationX",description:"Rotation around X in radians.",editor:"number-stepper"})],n.prototype,"rotationX",void 0),t.__decorate([o.Field({type:"number",step:.01,group:"Text3D",label:"rotationY",description:"Rotation around Y in radians.",editor:"number-stepper"})],n.prototype,"rotationY",void 0),t.__decorate([o.Field({type:"number",step:.01,group:"Text3D",label:"rotationZ",description:"Rotation around Z in radians.",editor:"number-stepper"})],n.prototype,"rotationZ",void 0);let s=class extends i.Renderer3D{constructor(){super(...arguments),this.name="Text3DSystem",this.texts=new Map}static{this.systemName="Text3DSystem"}init(){this.game.getSystem(i.Renderer3DSystem).rendererManager.register(this)}componentChanged(t){"Text3D"===t.componentName&&(t.type===e.OBSERVER_TYPE.ADD?this.handleAdd(t.gameObject,t.component):t.type===e.OBSERVER_TYPE.REMOVE?this.handleRemove(t.gameObject.id):this.handleChange(t.gameObject.id,t.component))}rendererUpdate(t){const e=t.getComponent(n);if(!e)return;const o=this.texts.get(t.id);o&&(o.position.set(e.positionX,e.positionY,e.positionZ),o.rotation.set(e.rotationX,e.rotationY,e.rotationZ))}handleAdd(t,e){const o=new r.Text;this.syncTextProps(o,e),o.sync(),this.threeContext.scene.add(o),this.texts.set(t.id,o)}handleChange(t,e){const o=this.texts.get(t);o&&(this.syncTextProps(o,e),o.sync())}handleRemove(t){const e=this.texts.get(t);e&&(this.threeContext.scene.remove(e),e.dispose(),this.texts.delete(t))}syncTextProps(t,e){t.text=e.text,t.fontSize=e.fontSize,t.color=e.color,t.anchorX=e.anchorX,t.anchorY=e.anchorY,e.maxWidth>0&&(t.maxWidth=e.maxWidth),e.font&&(t.font=e.font),t.position.set(e.positionX,e.positionY,e.positionZ),t.rotation.set(e.rotationX,e.rotationY,e.rotationZ)}onDestroy(){for(const[t]of this.texts)this.handleRemove(t);this.texts.clear()}};s=t.__decorate([e.decorators.componentObserver({Text3D:["text","fontSize","color","anchorX","anchorY","maxWidth","font","positionX","positionY","positionZ","rotationX","rotationY","rotationZ"]})],s);var p=s;exports.Text3D=n,exports.Text3DSystem=p;
@@ -1,6 +1,6 @@
1
1
  import { __decorate } from 'tslib';
2
2
  import { Component, OBSERVER_TYPE, decorators } from '@combos-fun/engine';
3
- import { type, step } from '@combos-fun/inspector-decorator';
3
+ import { Field } from '@combos-fun/inspector-decorator';
4
4
  import { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';
5
5
  import { Text } from 'troika-three-text';
6
6
 
@@ -28,51 +28,129 @@ class Text3D extends Component {
28
28
  }
29
29
  }
30
30
  __decorate([
31
- type('string')
31
+ Field({
32
+ type: 'string',
33
+ group: 'Text3D',
34
+ label: 'text',
35
+ description: 'Visible text content.',
36
+ editor: 'text',
37
+ })
32
38
  ], Text3D.prototype, "text", void 0);
33
39
  __decorate([
34
- type('number'),
35
- step(0.01)
40
+ Field({
41
+ type: 'number',
42
+ step: 0.01,
43
+ group: 'Text3D',
44
+ label: 'fontSize',
45
+ description: 'Font size.',
46
+ editor: 'number-stepper',
47
+ })
36
48
  ], Text3D.prototype, "fontSize", void 0);
37
49
  __decorate([
38
- type('number')
50
+ Field({
51
+ type: 'number',
52
+ group: 'Text3D',
53
+ label: 'color',
54
+ description: 'Color value.',
55
+ editor: 'number-stepper',
56
+ })
39
57
  ], Text3D.prototype, "color", void 0);
40
58
  __decorate([
41
- type('string')
59
+ Field({
60
+ type: 'string',
61
+ group: 'Text3D',
62
+ label: 'anchorX',
63
+ description: 'Horizontal text anchor.',
64
+ editor: 'text',
65
+ })
42
66
  ], Text3D.prototype, "anchorX", void 0);
43
67
  __decorate([
44
- type('string')
68
+ Field({
69
+ type: 'string',
70
+ group: 'Text3D',
71
+ label: 'anchorY',
72
+ description: 'Vertical text anchor.',
73
+ editor: 'text',
74
+ })
45
75
  ], Text3D.prototype, "anchorY", void 0);
46
76
  __decorate([
47
- type('number'),
48
- step(0.1)
77
+ Field({
78
+ type: 'number',
79
+ step: 0.1,
80
+ group: 'Text3D',
81
+ label: 'maxWidth',
82
+ description: 'Maximum text wrap width.',
83
+ editor: 'number-stepper',
84
+ })
49
85
  ], Text3D.prototype, "maxWidth", void 0);
50
86
  __decorate([
51
- type('string')
87
+ Field({
88
+ type: 'string',
89
+ group: 'Text3D',
90
+ label: 'font',
91
+ description: 'Font resource id.',
92
+ editor: 'text',
93
+ })
52
94
  ], Text3D.prototype, "font", void 0);
53
95
  __decorate([
54
- type('number'),
55
- step(0.1)
96
+ Field({
97
+ type: 'number',
98
+ step: 0.1,
99
+ group: 'Text3D',
100
+ label: 'positionX',
101
+ description: 'Local X position.',
102
+ editor: 'number-stepper',
103
+ })
56
104
  ], Text3D.prototype, "positionX", void 0);
57
105
  __decorate([
58
- type('number'),
59
- step(0.1)
106
+ Field({
107
+ type: 'number',
108
+ step: 0.1,
109
+ group: 'Text3D',
110
+ label: 'positionY',
111
+ description: 'Local Y position.',
112
+ editor: 'number-stepper',
113
+ })
60
114
  ], Text3D.prototype, "positionY", void 0);
61
115
  __decorate([
62
- type('number'),
63
- step(0.1)
116
+ Field({
117
+ type: 'number',
118
+ step: 0.1,
119
+ group: 'Text3D',
120
+ label: 'positionZ',
121
+ description: 'Local Z position.',
122
+ editor: 'number-stepper',
123
+ })
64
124
  ], Text3D.prototype, "positionZ", void 0);
65
125
  __decorate([
66
- type('number'),
67
- step(0.01)
126
+ Field({
127
+ type: 'number',
128
+ step: 0.01,
129
+ group: 'Text3D',
130
+ label: 'rotationX',
131
+ description: 'Rotation around X in radians.',
132
+ editor: 'number-stepper',
133
+ })
68
134
  ], Text3D.prototype, "rotationX", void 0);
69
135
  __decorate([
70
- type('number'),
71
- step(0.01)
136
+ Field({
137
+ type: 'number',
138
+ step: 0.01,
139
+ group: 'Text3D',
140
+ label: 'rotationY',
141
+ description: 'Rotation around Y in radians.',
142
+ editor: 'number-stepper',
143
+ })
72
144
  ], Text3D.prototype, "rotationY", void 0);
73
145
  __decorate([
74
- type('number'),
75
- step(0.01)
146
+ Field({
147
+ type: 'number',
148
+ step: 0.01,
149
+ group: 'Text3D',
150
+ label: 'rotationZ',
151
+ description: 'Rotation around Z in radians.',
152
+ editor: 'number-stepper',
153
+ })
76
154
  ], Text3D.prototype, "rotationZ", void 0);
77
155
 
78
156
  let Text3DSystem = class Text3DSystem extends Renderer3D {
@@ -1 +1 @@
1
- {"version":3,"file":"plugin-renderer-3d-text.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { type, step } from '@combos-fun/inspector-decorator';\n\nexport interface Text3DParams {\n text?: string;\n fontSize?: number;\n color?: number;\n anchorX?: string;\n anchorY?: string;\n maxWidth?: number;\n font?: string;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n}\n\nexport default class Text3D extends Component<Text3DParams> {\n static componentName: string = 'Text3D';\n\n @type('string') text: string = '';\n @type('number') @step(0.01) fontSize: number = 0.5;\n @type('number') color: number = 0xffffff;\n @type('string') anchorX: string = 'center';\n @type('string') anchorY: string = 'middle';\n @type('number') @step(0.1) maxWidth: number = 0;\n @type('string') font: string = '';\n @type('number') @step(0.1) positionX: number = 0;\n @type('number') @step(0.1) positionY: number = 0;\n @type('number') @step(0.1) positionZ: number = 0;\n @type('number') @step(0.01) rotationX: number = 0;\n @type('number') @step(0.01) rotationY: number = 0;\n @type('number') @step(0.01) rotationZ: number = 0;\n\n init(obj?: Text3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport { Text as TroikaText } from 'troika-three-text';\nimport Text3D from './component';\n\n@decorators.componentObserver({\n Text3D: [\n 'text', 'fontSize', 'color', 'anchorX', 'anchorY', 'maxWidth', 'font',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n ],\n})\nexport default class Text3DSystem extends Renderer3D {\n static systemName = 'Text3DSystem';\n name: string = 'Text3DSystem';\n\n private texts: Map<number, TroikaText> = new Map();\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Text3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Text3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed.gameObject.id, changed.component as Text3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Text3D) as Text3D;\n if (!component) return;\n\n const textMesh = this.texts.get(gameObject.id);\n if (!textMesh) return;\n\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Text3D) {\n const textMesh = new TroikaText();\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n\n this.threeContext.scene.add(textMesh);\n this.texts.set(gameObject.id, textMesh);\n }\n\n private handleChange(id: number, component: Text3D) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n }\n\n private handleRemove(id: number) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.threeContext.scene.remove(textMesh);\n textMesh.dispose();\n this.texts.delete(id);\n }\n\n private syncTextProps(textMesh: TroikaText, component: Text3D) {\n textMesh.text = component.text;\n textMesh.fontSize = component.fontSize;\n textMesh.color = component.color;\n textMesh.anchorX = component.anchorX;\n textMesh.anchorY = component.anchorY;\n if (component.maxWidth > 0) {\n textMesh.maxWidth = component.maxWidth;\n }\n if (component.font) {\n textMesh.font = component.font;\n }\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n onDestroy() {\n for (const [id] of this.texts) {\n this.handleRemove(id);\n }\n this.texts.clear();\n }\n}\n"],"names":["TroikaText"],"mappings":";;;;;;AAmBc,MAAO,MAAO,SAAQ,SAAuB,CAAA;AAA3D,IAAA,WAAA,GAAA;;QAGkB,IAAA,CAAA,IAAI,GAAW,EAAE;QACL,IAAA,CAAA,QAAQ,GAAW,GAAG;QAClC,IAAA,CAAA,KAAK,GAAW,QAAQ;QACxB,IAAA,CAAA,OAAO,GAAW,QAAQ;QAC1B,IAAA,CAAA,OAAO,GAAW,QAAQ;QACf,IAAA,CAAA,QAAQ,GAAW,CAAC;QAC/B,IAAA,CAAA,IAAI,GAAW,EAAE;QACN,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACpB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;QACrB,IAAA,CAAA,SAAS,GAAW,CAAC;IAKnD;aAnBS,IAAA,CAAA,aAAa,GAAW,QAAX,CAAoB;AAgBxC,IAAA,IAAI,CAAC,GAAkB,EAAA;AACrB,QAAA,IAAI,GAAG;AAAE,YAAA,MAAM,CAAC,MAAM,CAAC,IAAI,EAAE,GAAG,CAAC;IACnC;;AAhBgB,UAAA,CAAA;IAAf,IAAI,CAAC,QAAQ;AAAoB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AACN,UAAA,CAAA;IAA3B,IAAI,CAAC,QAAQ,CAAC;IAAE,IAAI,CAAC,IAAI;AAAyB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,C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W,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;AACtC,SAAA;KACF;AACoB,CAAA,EAAA,YAAY,CAkFhC;2BAlFoB,YAAY;;;;"}
1
+ {"version":3,"file":"plugin-renderer-3d-text.esm.js","sources":["../lib/component.ts","../lib/system.ts"],"sourcesContent":["import { Component } from '@combos-fun/engine';\nimport { Field } from '@combos-fun/inspector-decorator';\n\nexport interface Text3DParams {\n text?: string;\n fontSize?: number;\n color?: number;\n anchorX?: string;\n anchorY?: string;\n maxWidth?: number;\n font?: string;\n positionX?: number;\n positionY?: number;\n positionZ?: number;\n rotationX?: number;\n rotationY?: number;\n rotationZ?: number;\n}\n\nexport default class Text3D extends Component<Text3DParams> {\n static componentName: string = 'Text3D';\n\n @Field({\n\n type: 'string',\n\n group: 'Text3D',\n\n label: 'text',\n\n description: 'Visible text content.',\n\n editor: 'text',\n\n })\n\n text: string = '';\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'fontSize',\n description: 'Font size.',\n editor: 'number-stepper',\n })\n fontSize: number = 0.5;\n @Field({\n type: 'number',\n group: 'Text3D',\n label: 'color',\n description: 'Color value.',\n editor: 'number-stepper',\n })\n color: number = 0xffffff;\n @Field({\n type: 'string',\n group: 'Text3D',\n label: 'anchorX',\n description: 'Horizontal text anchor.',\n editor: 'text',\n })\n anchorX: string = 'center';\n @Field({\n type: 'string',\n group: 'Text3D',\n label: 'anchorY',\n description: 'Vertical text anchor.',\n editor: 'text',\n })\n anchorY: string = 'middle';\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'maxWidth',\n description: 'Maximum text wrap width.',\n editor: 'number-stepper',\n })\n maxWidth: number = 0;\n @Field({\n type: 'string',\n group: 'Text3D',\n label: 'font',\n description: 'Font resource id.',\n editor: 'text',\n })\n font: string = '';\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'positionX',\n description: 'Local X position.',\n editor: 'number-stepper',\n })\n positionX: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'positionY',\n description: 'Local Y position.',\n editor: 'number-stepper',\n })\n positionY: number = 0;\n @Field({\n type: 'number',\n step: 0.1,\n group: 'Text3D',\n label: 'positionZ',\n description: 'Local Z position.',\n editor: 'number-stepper',\n })\n positionZ: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'rotationX',\n description: 'Rotation around X in radians.',\n editor: 'number-stepper',\n })\n rotationX: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'rotationY',\n description: 'Rotation around Y in radians.',\n editor: 'number-stepper',\n })\n rotationY: number = 0;\n @Field({\n type: 'number',\n step: 0.01,\n group: 'Text3D',\n label: 'rotationZ',\n description: 'Rotation around Z in radians.',\n editor: 'number-stepper',\n })\n rotationZ: number = 0;\n\n init(obj?: Text3DParams) {\n if (obj) Object.assign(this, obj);\n }\n}\n","import { decorators, ComponentChanged, OBSERVER_TYPE, GameObject } from '@combos-fun/engine';\nimport { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';\nimport { Text as TroikaText } from 'troika-three-text';\nimport Text3D from './component';\n\n@decorators.componentObserver({\n Text3D: [\n 'text', 'fontSize', 'color', 'anchorX', 'anchorY', 'maxWidth', 'font',\n 'positionX', 'positionY', 'positionZ',\n 'rotationX', 'rotationY', 'rotationZ',\n ],\n})\nexport default class Text3DSystem extends Renderer3D {\n static systemName = 'Text3DSystem';\n name: string = 'Text3DSystem';\n\n private texts: Map<number, TroikaText> = new Map();\n\n init() {\n const renderer3DSystem = this.game.getSystem(Renderer3DSystem) as Renderer3DSystem;\n renderer3DSystem.rendererManager.register(this);\n }\n\n componentChanged(changed: ComponentChanged) {\n if (changed.componentName !== 'Text3D') return;\n\n if (changed.type === OBSERVER_TYPE.ADD) {\n this.handleAdd(changed.gameObject, changed.component as Text3D);\n } else if (changed.type === OBSERVER_TYPE.REMOVE) {\n this.handleRemove(changed.gameObject.id);\n } else {\n this.handleChange(changed.gameObject.id, changed.component as Text3D);\n }\n }\n\n rendererUpdate(gameObject: GameObject) {\n const component = gameObject.getComponent(Text3D) as Text3D;\n if (!component) return;\n\n const textMesh = this.texts.get(gameObject.id);\n if (!textMesh) return;\n\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n private handleAdd(gameObject: GameObject, component: Text3D) {\n const textMesh = new TroikaText();\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n\n this.threeContext.scene.add(textMesh);\n this.texts.set(gameObject.id, textMesh);\n }\n\n private handleChange(id: number, component: Text3D) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.syncTextProps(textMesh, component);\n textMesh.sync();\n }\n\n private handleRemove(id: number) {\n const textMesh = this.texts.get(id);\n if (!textMesh) return;\n\n this.threeContext.scene.remove(textMesh);\n textMesh.dispose();\n this.texts.delete(id);\n }\n\n private syncTextProps(textMesh: TroikaText, component: Text3D) {\n textMesh.text = component.text;\n textMesh.fontSize = component.fontSize;\n textMesh.color = component.color;\n textMesh.anchorX = component.anchorX;\n textMesh.anchorY = component.anchorY;\n if (component.maxWidth > 0) {\n textMesh.maxWidth = component.maxWidth;\n }\n if (component.font) {\n textMesh.font = component.font;\n }\n textMesh.position.set(component.positionX, component.positionY, component.positionZ);\n textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);\n }\n\n onDestroy() {\n for (const [id] of this.texts) {\n this.handleRemove(id);\n }\n this.texts.clear();\n }\n}\n"],"names":["TroikaText"],"mappings":";;;;;;AAmBc,MAAO,MAAO,SAAQ,SAAuB,CAAA;AAA3D,IAAA,WAAA,GAAA;;QAiBE,IAAA,CAAA,IAAI,GAAW,EAAE;QASjB,IAAA,CAAA,QAAQ,GAAW,GAAG;QAQtB,IAAA,CAAA,KAAK,GAAW,QAAQ;QAQxB,IAAA,CAAA,OAAO,GAAW,QAAQ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I,IAAI,CAAC,KAAK,EAAE;AAC7B,YAAA,IAAI,CAAC,YAAY,CAAC,EAAE,CAAC;QACvB;AACA,QAAA,IAAI,CAAC,KAAK,CAAC,KAAK,EAAE;IACpB;;AAjFmB,YAAY,GAAA,UAAA,CAAA;IAPhC,UAAU,CAAC,iBAAiB,CAAC;AAC5B,QAAA,MAAM,EAAE;YACN,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,SAAS,EAAE,SAAS,EAAE,UAAU,EAAE,MAAM;YACrE,WAAW,EAAE,WAAW,EAAE,WAAW;YACrC,WAAW,EAAE,WAAW,EAAE,WAAW;AACtC,SAAA;KACF;AACoB,CAAA,EAAA,YAAY,CAkFhC;2BAlFoB,YAAY;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@combos-fun/plugin-renderer-3d-text",
3
- "version": "0.0.33",
3
+ "version": "0.0.35",
4
4
  "description": "3D text rendering, backed by troika-three-text",
5
5
  "main": "index.js",
6
6
  "module": "dist/plugin-renderer-3d-text.esm.js",
@@ -28,9 +28,9 @@
28
28
  "dependencies": {
29
29
  "three": "^0.172.0",
30
30
  "troika-three-text": "^0.52.3",
31
- "@combos-fun/engine": "0.0.33",
32
- "@combos-fun/plugin-renderer-3d": "0.0.33",
33
- "@combos-fun/inspector-decorator": "0.0.33"
31
+ "@combos-fun/engine": "0.0.35",
32
+ "@combos-fun/plugin-renderer-3d": "0.0.35",
33
+ "@combos-fun/inspector-decorator": "0.0.35"
34
34
  },
35
35
  "keywords": [
36
36
  "combos-fun",