@combos-fun/plugin-renderer-3d-text 0.0.6
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.
- package/dist/plugin-renderer-3d-text.cjs.js +171 -0
- package/dist/plugin-renderer-3d-text.cjs.js.map +1 -0
- package/dist/plugin-renderer-3d-text.cjs.prod.js +1 -0
- package/dist/plugin-renderer-3d-text.d.ts +52 -0
- package/dist/plugin-renderer-3d-text.esm.js +168 -0
- package/dist/plugin-renderer-3d-text.esm.js.map +1 -0
- package/index.js +7 -0
- package/package.json +24 -0
|
@@ -0,0 +1,171 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
var tslib = require('tslib');
|
|
4
|
+
var engine = require('@combos-fun/engine');
|
|
5
|
+
var inspectorDecorator = require('@combos-fun/inspector-decorator');
|
|
6
|
+
var pluginRenderer3d = require('@combos-fun/plugin-renderer-3d');
|
|
7
|
+
var troikaThreeText = require('troika-three-text');
|
|
8
|
+
|
|
9
|
+
class Text3D extends engine.Component {
|
|
10
|
+
constructor() {
|
|
11
|
+
super(...arguments);
|
|
12
|
+
this.text = '';
|
|
13
|
+
this.fontSize = 0.5;
|
|
14
|
+
this.color = 0xffffff;
|
|
15
|
+
this.anchorX = 'center';
|
|
16
|
+
this.anchorY = 'middle';
|
|
17
|
+
this.maxWidth = 0;
|
|
18
|
+
this.font = '';
|
|
19
|
+
this.positionX = 0;
|
|
20
|
+
this.positionY = 0;
|
|
21
|
+
this.positionZ = 0;
|
|
22
|
+
this.rotationX = 0;
|
|
23
|
+
this.rotationY = 0;
|
|
24
|
+
this.rotationZ = 0;
|
|
25
|
+
}
|
|
26
|
+
static { this.componentName = 'Text3D'; }
|
|
27
|
+
init(obj) {
|
|
28
|
+
if (obj)
|
|
29
|
+
Object.assign(this, obj);
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
tslib.__decorate([
|
|
33
|
+
inspectorDecorator.type('string')
|
|
34
|
+
], Text3D.prototype, "text", void 0);
|
|
35
|
+
tslib.__decorate([
|
|
36
|
+
inspectorDecorator.type('number'),
|
|
37
|
+
inspectorDecorator.step(0.01)
|
|
38
|
+
], Text3D.prototype, "fontSize", void 0);
|
|
39
|
+
tslib.__decorate([
|
|
40
|
+
inspectorDecorator.type('number')
|
|
41
|
+
], Text3D.prototype, "color", void 0);
|
|
42
|
+
tslib.__decorate([
|
|
43
|
+
inspectorDecorator.type('string')
|
|
44
|
+
], Text3D.prototype, "anchorX", void 0);
|
|
45
|
+
tslib.__decorate([
|
|
46
|
+
inspectorDecorator.type('string')
|
|
47
|
+
], Text3D.prototype, "anchorY", void 0);
|
|
48
|
+
tslib.__decorate([
|
|
49
|
+
inspectorDecorator.type('number'),
|
|
50
|
+
inspectorDecorator.step(0.1)
|
|
51
|
+
], Text3D.prototype, "maxWidth", void 0);
|
|
52
|
+
tslib.__decorate([
|
|
53
|
+
inspectorDecorator.type('string')
|
|
54
|
+
], Text3D.prototype, "font", void 0);
|
|
55
|
+
tslib.__decorate([
|
|
56
|
+
inspectorDecorator.type('number'),
|
|
57
|
+
inspectorDecorator.step(0.1)
|
|
58
|
+
], Text3D.prototype, "positionX", void 0);
|
|
59
|
+
tslib.__decorate([
|
|
60
|
+
inspectorDecorator.type('number'),
|
|
61
|
+
inspectorDecorator.step(0.1)
|
|
62
|
+
], Text3D.prototype, "positionY", void 0);
|
|
63
|
+
tslib.__decorate([
|
|
64
|
+
inspectorDecorator.type('number'),
|
|
65
|
+
inspectorDecorator.step(0.1)
|
|
66
|
+
], Text3D.prototype, "positionZ", void 0);
|
|
67
|
+
tslib.__decorate([
|
|
68
|
+
inspectorDecorator.type('number'),
|
|
69
|
+
inspectorDecorator.step(0.01)
|
|
70
|
+
], Text3D.prototype, "rotationX", void 0);
|
|
71
|
+
tslib.__decorate([
|
|
72
|
+
inspectorDecorator.type('number'),
|
|
73
|
+
inspectorDecorator.step(0.01)
|
|
74
|
+
], Text3D.prototype, "rotationY", void 0);
|
|
75
|
+
tslib.__decorate([
|
|
76
|
+
inspectorDecorator.type('number'),
|
|
77
|
+
inspectorDecorator.step(0.01)
|
|
78
|
+
], Text3D.prototype, "rotationZ", void 0);
|
|
79
|
+
|
|
80
|
+
let Text3DSystem = class Text3DSystem extends pluginRenderer3d.Renderer3D {
|
|
81
|
+
constructor() {
|
|
82
|
+
super(...arguments);
|
|
83
|
+
this.name = 'Text3DSystem';
|
|
84
|
+
this.texts = new Map();
|
|
85
|
+
}
|
|
86
|
+
static { this.systemName = 'Text3DSystem'; }
|
|
87
|
+
init() {
|
|
88
|
+
const renderer3DSystem = this.game.getSystem(pluginRenderer3d.Renderer3DSystem);
|
|
89
|
+
renderer3DSystem.rendererManager.register(this);
|
|
90
|
+
}
|
|
91
|
+
componentChanged(changed) {
|
|
92
|
+
if (changed.componentName !== 'Text3D')
|
|
93
|
+
return;
|
|
94
|
+
if (changed.type === engine.OBSERVER_TYPE.ADD) {
|
|
95
|
+
this.handleAdd(changed.gameObject, changed.component);
|
|
96
|
+
}
|
|
97
|
+
else if (changed.type === engine.OBSERVER_TYPE.REMOVE) {
|
|
98
|
+
this.handleRemove(changed.gameObject.id);
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
this.handleChange(changed.gameObject.id, changed.component);
|
|
102
|
+
}
|
|
103
|
+
}
|
|
104
|
+
rendererUpdate(gameObject) {
|
|
105
|
+
const component = gameObject.getComponent(Text3D);
|
|
106
|
+
if (!component)
|
|
107
|
+
return;
|
|
108
|
+
const textMesh = this.texts.get(gameObject.id);
|
|
109
|
+
if (!textMesh)
|
|
110
|
+
return;
|
|
111
|
+
textMesh.position.set(component.positionX, component.positionY, component.positionZ);
|
|
112
|
+
textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);
|
|
113
|
+
}
|
|
114
|
+
handleAdd(gameObject, component) {
|
|
115
|
+
const textMesh = new troikaThreeText.Text();
|
|
116
|
+
this.syncTextProps(textMesh, component);
|
|
117
|
+
textMesh.sync();
|
|
118
|
+
this.threeContext.scene.add(textMesh);
|
|
119
|
+
this.texts.set(gameObject.id, textMesh);
|
|
120
|
+
}
|
|
121
|
+
handleChange(id, component) {
|
|
122
|
+
const textMesh = this.texts.get(id);
|
|
123
|
+
if (!textMesh)
|
|
124
|
+
return;
|
|
125
|
+
this.syncTextProps(textMesh, component);
|
|
126
|
+
textMesh.sync();
|
|
127
|
+
}
|
|
128
|
+
handleRemove(id) {
|
|
129
|
+
const textMesh = this.texts.get(id);
|
|
130
|
+
if (!textMesh)
|
|
131
|
+
return;
|
|
132
|
+
this.threeContext.scene.remove(textMesh);
|
|
133
|
+
textMesh.dispose();
|
|
134
|
+
this.texts.delete(id);
|
|
135
|
+
}
|
|
136
|
+
syncTextProps(textMesh, component) {
|
|
137
|
+
textMesh.text = component.text;
|
|
138
|
+
textMesh.fontSize = component.fontSize;
|
|
139
|
+
textMesh.color = component.color;
|
|
140
|
+
textMesh.anchorX = component.anchorX;
|
|
141
|
+
textMesh.anchorY = component.anchorY;
|
|
142
|
+
if (component.maxWidth > 0) {
|
|
143
|
+
textMesh.maxWidth = component.maxWidth;
|
|
144
|
+
}
|
|
145
|
+
if (component.font) {
|
|
146
|
+
textMesh.font = component.font;
|
|
147
|
+
}
|
|
148
|
+
textMesh.position.set(component.positionX, component.positionY, component.positionZ);
|
|
149
|
+
textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);
|
|
150
|
+
}
|
|
151
|
+
onDestroy() {
|
|
152
|
+
for (const [id] of this.texts) {
|
|
153
|
+
this.handleRemove(id);
|
|
154
|
+
}
|
|
155
|
+
this.texts.clear();
|
|
156
|
+
}
|
|
157
|
+
};
|
|
158
|
+
Text3DSystem = tslib.__decorate([
|
|
159
|
+
engine.decorators.componentObserver({
|
|
160
|
+
Text3D: [
|
|
161
|
+
'text', 'fontSize', 'color', 'anchorX', 'anchorY', 'maxWidth', 'font',
|
|
162
|
+
'positionX', 'positionY', 'positionZ',
|
|
163
|
+
'rotationX', 'rotationY', 'rotationZ',
|
|
164
|
+
],
|
|
165
|
+
})
|
|
166
|
+
], Text3DSystem);
|
|
167
|
+
var Text3DSystem_default = Text3DSystem;
|
|
168
|
+
|
|
169
|
+
exports.Text3D = Text3D;
|
|
170
|
+
exports.Text3DSystem = Text3DSystem_default;
|
|
171
|
+
//# sourceMappingURL=plugin-renderer-3d-text.cjs.js.map
|
|
@@ -0,0 +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,EAAA,MAAA,CAAA,SAAA,EAAA,MAAA,EAAA,MAAA,CAAA;AACND,gBAAA,CAAA;IAA3BC,uBAAI,CAAC,QAAQ,CAAC;IAAEC,uBAAI,CAAC,IAAI;AAAyB,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AACnCF,gBA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E,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;;;;;"}
|
|
@@ -0,0 +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;
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
import { Component, ComponentChanged, GameObject } from '@combos-fun/engine';
|
|
2
|
+
import { Renderer3D } from '@combos-fun/plugin-renderer-3d';
|
|
3
|
+
|
|
4
|
+
interface Text3DParams {
|
|
5
|
+
text?: string;
|
|
6
|
+
fontSize?: number;
|
|
7
|
+
color?: number;
|
|
8
|
+
anchorX?: string;
|
|
9
|
+
anchorY?: string;
|
|
10
|
+
maxWidth?: number;
|
|
11
|
+
font?: string;
|
|
12
|
+
positionX?: number;
|
|
13
|
+
positionY?: number;
|
|
14
|
+
positionZ?: number;
|
|
15
|
+
rotationX?: number;
|
|
16
|
+
rotationY?: number;
|
|
17
|
+
rotationZ?: number;
|
|
18
|
+
}
|
|
19
|
+
declare class Text3D extends Component<Text3DParams> {
|
|
20
|
+
static componentName: string;
|
|
21
|
+
text: string;
|
|
22
|
+
fontSize: number;
|
|
23
|
+
color: number;
|
|
24
|
+
anchorX: string;
|
|
25
|
+
anchorY: string;
|
|
26
|
+
maxWidth: number;
|
|
27
|
+
font: string;
|
|
28
|
+
positionX: number;
|
|
29
|
+
positionY: number;
|
|
30
|
+
positionZ: number;
|
|
31
|
+
rotationX: number;
|
|
32
|
+
rotationY: number;
|
|
33
|
+
rotationZ: number;
|
|
34
|
+
init(obj?: Text3DParams): void;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
declare class Text3DSystem extends Renderer3D {
|
|
38
|
+
static systemName: string;
|
|
39
|
+
name: string;
|
|
40
|
+
private texts;
|
|
41
|
+
init(): void;
|
|
42
|
+
componentChanged(changed: ComponentChanged): void;
|
|
43
|
+
rendererUpdate(gameObject: GameObject): void;
|
|
44
|
+
private handleAdd;
|
|
45
|
+
private handleChange;
|
|
46
|
+
private handleRemove;
|
|
47
|
+
private syncTextProps;
|
|
48
|
+
onDestroy(): void;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export { Text3D, Text3DSystem };
|
|
52
|
+
export type { Text3DParams };
|
|
@@ -0,0 +1,168 @@
|
|
|
1
|
+
import { __decorate } from 'tslib';
|
|
2
|
+
import { Component, OBSERVER_TYPE, decorators } from '@combos-fun/engine';
|
|
3
|
+
import { type, step } from '@combos-fun/inspector-decorator';
|
|
4
|
+
import { Renderer3D, Renderer3DSystem } from '@combos-fun/plugin-renderer-3d';
|
|
5
|
+
import { Text } from 'troika-three-text';
|
|
6
|
+
|
|
7
|
+
class Text3D extends Component {
|
|
8
|
+
constructor() {
|
|
9
|
+
super(...arguments);
|
|
10
|
+
this.text = '';
|
|
11
|
+
this.fontSize = 0.5;
|
|
12
|
+
this.color = 0xffffff;
|
|
13
|
+
this.anchorX = 'center';
|
|
14
|
+
this.anchorY = 'middle';
|
|
15
|
+
this.maxWidth = 0;
|
|
16
|
+
this.font = '';
|
|
17
|
+
this.positionX = 0;
|
|
18
|
+
this.positionY = 0;
|
|
19
|
+
this.positionZ = 0;
|
|
20
|
+
this.rotationX = 0;
|
|
21
|
+
this.rotationY = 0;
|
|
22
|
+
this.rotationZ = 0;
|
|
23
|
+
}
|
|
24
|
+
static { this.componentName = 'Text3D'; }
|
|
25
|
+
init(obj) {
|
|
26
|
+
if (obj)
|
|
27
|
+
Object.assign(this, obj);
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
__decorate([
|
|
31
|
+
type('string')
|
|
32
|
+
], Text3D.prototype, "text", void 0);
|
|
33
|
+
__decorate([
|
|
34
|
+
type('number'),
|
|
35
|
+
step(0.01)
|
|
36
|
+
], Text3D.prototype, "fontSize", void 0);
|
|
37
|
+
__decorate([
|
|
38
|
+
type('number')
|
|
39
|
+
], Text3D.prototype, "color", void 0);
|
|
40
|
+
__decorate([
|
|
41
|
+
type('string')
|
|
42
|
+
], Text3D.prototype, "anchorX", void 0);
|
|
43
|
+
__decorate([
|
|
44
|
+
type('string')
|
|
45
|
+
], Text3D.prototype, "anchorY", void 0);
|
|
46
|
+
__decorate([
|
|
47
|
+
type('number'),
|
|
48
|
+
step(0.1)
|
|
49
|
+
], Text3D.prototype, "maxWidth", void 0);
|
|
50
|
+
__decorate([
|
|
51
|
+
type('string')
|
|
52
|
+
], Text3D.prototype, "font", void 0);
|
|
53
|
+
__decorate([
|
|
54
|
+
type('number'),
|
|
55
|
+
step(0.1)
|
|
56
|
+
], Text3D.prototype, "positionX", void 0);
|
|
57
|
+
__decorate([
|
|
58
|
+
type('number'),
|
|
59
|
+
step(0.1)
|
|
60
|
+
], Text3D.prototype, "positionY", void 0);
|
|
61
|
+
__decorate([
|
|
62
|
+
type('number'),
|
|
63
|
+
step(0.1)
|
|
64
|
+
], Text3D.prototype, "positionZ", void 0);
|
|
65
|
+
__decorate([
|
|
66
|
+
type('number'),
|
|
67
|
+
step(0.01)
|
|
68
|
+
], Text3D.prototype, "rotationX", void 0);
|
|
69
|
+
__decorate([
|
|
70
|
+
type('number'),
|
|
71
|
+
step(0.01)
|
|
72
|
+
], Text3D.prototype, "rotationY", void 0);
|
|
73
|
+
__decorate([
|
|
74
|
+
type('number'),
|
|
75
|
+
step(0.01)
|
|
76
|
+
], Text3D.prototype, "rotationZ", void 0);
|
|
77
|
+
|
|
78
|
+
let Text3DSystem = class Text3DSystem extends Renderer3D {
|
|
79
|
+
constructor() {
|
|
80
|
+
super(...arguments);
|
|
81
|
+
this.name = 'Text3DSystem';
|
|
82
|
+
this.texts = new Map();
|
|
83
|
+
}
|
|
84
|
+
static { this.systemName = 'Text3DSystem'; }
|
|
85
|
+
init() {
|
|
86
|
+
const renderer3DSystem = this.game.getSystem(Renderer3DSystem);
|
|
87
|
+
renderer3DSystem.rendererManager.register(this);
|
|
88
|
+
}
|
|
89
|
+
componentChanged(changed) {
|
|
90
|
+
if (changed.componentName !== 'Text3D')
|
|
91
|
+
return;
|
|
92
|
+
if (changed.type === OBSERVER_TYPE.ADD) {
|
|
93
|
+
this.handleAdd(changed.gameObject, changed.component);
|
|
94
|
+
}
|
|
95
|
+
else if (changed.type === OBSERVER_TYPE.REMOVE) {
|
|
96
|
+
this.handleRemove(changed.gameObject.id);
|
|
97
|
+
}
|
|
98
|
+
else {
|
|
99
|
+
this.handleChange(changed.gameObject.id, changed.component);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
102
|
+
rendererUpdate(gameObject) {
|
|
103
|
+
const component = gameObject.getComponent(Text3D);
|
|
104
|
+
if (!component)
|
|
105
|
+
return;
|
|
106
|
+
const textMesh = this.texts.get(gameObject.id);
|
|
107
|
+
if (!textMesh)
|
|
108
|
+
return;
|
|
109
|
+
textMesh.position.set(component.positionX, component.positionY, component.positionZ);
|
|
110
|
+
textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);
|
|
111
|
+
}
|
|
112
|
+
handleAdd(gameObject, component) {
|
|
113
|
+
const textMesh = new Text();
|
|
114
|
+
this.syncTextProps(textMesh, component);
|
|
115
|
+
textMesh.sync();
|
|
116
|
+
this.threeContext.scene.add(textMesh);
|
|
117
|
+
this.texts.set(gameObject.id, textMesh);
|
|
118
|
+
}
|
|
119
|
+
handleChange(id, component) {
|
|
120
|
+
const textMesh = this.texts.get(id);
|
|
121
|
+
if (!textMesh)
|
|
122
|
+
return;
|
|
123
|
+
this.syncTextProps(textMesh, component);
|
|
124
|
+
textMesh.sync();
|
|
125
|
+
}
|
|
126
|
+
handleRemove(id) {
|
|
127
|
+
const textMesh = this.texts.get(id);
|
|
128
|
+
if (!textMesh)
|
|
129
|
+
return;
|
|
130
|
+
this.threeContext.scene.remove(textMesh);
|
|
131
|
+
textMesh.dispose();
|
|
132
|
+
this.texts.delete(id);
|
|
133
|
+
}
|
|
134
|
+
syncTextProps(textMesh, component) {
|
|
135
|
+
textMesh.text = component.text;
|
|
136
|
+
textMesh.fontSize = component.fontSize;
|
|
137
|
+
textMesh.color = component.color;
|
|
138
|
+
textMesh.anchorX = component.anchorX;
|
|
139
|
+
textMesh.anchorY = component.anchorY;
|
|
140
|
+
if (component.maxWidth > 0) {
|
|
141
|
+
textMesh.maxWidth = component.maxWidth;
|
|
142
|
+
}
|
|
143
|
+
if (component.font) {
|
|
144
|
+
textMesh.font = component.font;
|
|
145
|
+
}
|
|
146
|
+
textMesh.position.set(component.positionX, component.positionY, component.positionZ);
|
|
147
|
+
textMesh.rotation.set(component.rotationX, component.rotationY, component.rotationZ);
|
|
148
|
+
}
|
|
149
|
+
onDestroy() {
|
|
150
|
+
for (const [id] of this.texts) {
|
|
151
|
+
this.handleRemove(id);
|
|
152
|
+
}
|
|
153
|
+
this.texts.clear();
|
|
154
|
+
}
|
|
155
|
+
};
|
|
156
|
+
Text3DSystem = __decorate([
|
|
157
|
+
decorators.componentObserver({
|
|
158
|
+
Text3D: [
|
|
159
|
+
'text', 'fontSize', 'color', 'anchorX', 'anchorY', 'maxWidth', 'font',
|
|
160
|
+
'positionX', 'positionY', 'positionZ',
|
|
161
|
+
'rotationX', 'rotationY', 'rotationZ',
|
|
162
|
+
],
|
|
163
|
+
})
|
|
164
|
+
], Text3DSystem);
|
|
165
|
+
var Text3DSystem_default = Text3DSystem;
|
|
166
|
+
|
|
167
|
+
export { Text3D, Text3DSystem_default as Text3DSystem };
|
|
168
|
+
//# sourceMappingURL=plugin-renderer-3d-text.esm.js.map
|
|
@@ -0,0 +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;;;;"}
|
package/index.js
ADDED
package/package.json
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@combos-fun/plugin-renderer-3d-text",
|
|
3
|
+
"version": "0.0.6",
|
|
4
|
+
"description": "@combos-fun/plugin-renderer-3d-text",
|
|
5
|
+
"main": "index.js",
|
|
6
|
+
"module": "dist/plugin-renderer-3d-text.esm.js",
|
|
7
|
+
"bundle": "CombosFun.plugin.renderer.3d.text",
|
|
8
|
+
"unpkg": "dist/CombosFun.plugin.renderer.3d.text.min.js",
|
|
9
|
+
"types": "dist/plugin-renderer-3d-text.d.ts",
|
|
10
|
+
"files": [
|
|
11
|
+
"index.js",
|
|
12
|
+
"dist"
|
|
13
|
+
],
|
|
14
|
+
"dependencies": {
|
|
15
|
+
"three": "^0.172.0",
|
|
16
|
+
"troika-three-text": "^0.52.3",
|
|
17
|
+
"@combos-fun/engine": "0.0.6",
|
|
18
|
+
"@combos-fun/plugin-renderer-3d": "0.0.6",
|
|
19
|
+
"@combos-fun/inspector-decorator": "0.0.6"
|
|
20
|
+
},
|
|
21
|
+
"scripts": {
|
|
22
|
+
"build": "node ../../scripts/build-package.mjs"
|
|
23
|
+
}
|
|
24
|
+
}
|