@shijiu/jsview-vue 2.1.200 → 2.1.339-test.0
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/bin/browser/BrowserApic.vue.mjs +124 -0
- package/bin/browser/BrowserApic2.vue.mjs +118 -0
- package/bin/browser/BrowserApicLib.mjs +424 -0
- package/bin/browser/BrowserAudio.vue.mjs +263 -0
- package/bin/browser/BrowserJsvLatex.vue.mjs +110 -0
- package/bin/browser/BrowserJsvPlayer.vue.mjs +573 -0
- package/bin/browser/BrowserPreload.vue.mjs +154 -0
- package/bin/browser/BrowserQrcode.vue.mjs +178 -0
- package/bin/browser/BrowserSpray.vue.mjs +66 -0
- package/bin/browser/BrowserTextureAnim.vue.mjs +324 -0
- package/bin/export-sfc.mjs +12 -0
- package/bin/jsview-common.mjs +39 -0
- package/bin/jsview-vue.mjs +21106 -0
- package/index.js +3 -4
- package/package.json +1 -2
- package/tools/config/rollup.config.mjs +52 -0
- package/tools/config/tsconfig.json +18 -0
- package/tools/config/vite.config.ts +60 -0
- package/tools/jsview-vue-build.mjs +125 -0
- package/utils/JsViewEngineWidget/{JsvFocusBlock.vue → JsvFocus/JsvFocusBlock.vue} +11 -11
- package/utils/JsViewEngineWidget/{JsvFocusHub.ts → JsvFocus/JsvFocusHub.ts} +9 -3
- package/utils/JsViewEngineWidget/{JsvFocusManager.js → JsvFocus/JsvFocusManager.js} +6 -5
- package/utils/JsViewEngineWidget/MetroWidget/AnimationManager.ts +33 -10
- package/utils/JsViewEngineWidget/MetroWidget/ListWidget.vue +89 -57
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidget.vue +118 -62
- package/utils/JsViewEngineWidget/MetroWidget/MetroWidgetSetup.js +504 -60
- package/utils/JsViewEngineWidget/MetroWidget/RenderItem.ts +11 -1
- package/utils/JsViewEngineWidget/MetroWidget/SlotComponent.vue +13 -0
- package/utils/JsViewEngineWidget/TemplateParser/CommonMetroTemplate.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/ListMetroTemplate.ts +1 -1
- package/utils/JsViewEngineWidget/TemplateParser/MetroTemplate.ts +34 -1
- package/utils/JsViewEngineWidget/TemplateParser/TemplateItemAdder.ts +52 -11
- package/utils/JsViewEngineWidget/index.js +3 -3
- package/utils/JsViewPlugin/JsvAudio/AudioProxy.js +9 -0
- package/utils/JsViewPlugin/JsvAudio/BrowserAudio/BrowserAudio.vue +11 -3
- package/utils/JsViewPlugin/JsvAudio/JsvAudio.vue +1 -0
- package/utils/JsViewPlugin/JsvAudio/JsvAudioBridgeProxy.js +8 -0
- package/utils/JsViewPlugin/JsvAudio/ScreenLockManager.js +16 -0
- package/utils/JsViewPlugin/JsvAudio/version.js +3 -3
- package/utils/JsViewPlugin/JsvAudio/version.mjs +3 -3
- package/utils/JsViewPlugin/JsvLatex/index.js +1 -1
- package/utils/JsViewPlugin/JsvPlayer/JsvPlayer.vue +1 -1
- package/utils/JsViewPlugin/JsvPlayer/index-0.9.js +3 -3
- package/utils/JsViewPlugin/JsvPlayer/index.js +2 -2
- package/utils/JsViewVueTools/DebugTool.js +2 -2
- package/utils/JsViewVueTools/DefaultKeyMap.js +1 -1
- package/utils/JsViewVueTools/JsvDynamicCssStyle.js +1 -1
- package/utils/JsViewVueTools/JsvDynamicKeyFrames.js +2 -2
- package/utils/JsViewVueTools/JsvImpactTracer.js +7 -7
- package/utils/JsViewVueTools/JsvPreDownloader.ts +1 -1
- package/utils/JsViewVueTools/JsvRefTaker.js +2 -1
- package/utils/JsViewVueTools/JsvRuntimeBridge.js +29 -29
- package/utils/JsViewVueTools/JsvStyleClass.js +3 -3
- package/utils/JsViewVueTools/JsvStyleSheetsDeclarer.js +1 -1
- package/utils/JsViewVueTools/JsvTextTools.js +4 -4
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CanvasTexture.ts +29 -1
- package/utils/JsViewVueTools/JsvTextureStore/CanvasTexture/CommandList.ts +6 -5
- package/utils/JsViewVueTools/JsvTextureStore/JsvTextureStore.ts +60 -2
- package/utils/JsViewVueTools/NinePatchHelper.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/ActorControlBase.js +1 -1
- package/utils/JsViewVueWidget/JsvActorMove/JsvActorMoveControl.js +1 -1
- package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvApic}/BrowserApic.vue +20 -23
- package/utils/JsViewVueWidget/JsvApic/{JsvApic.vue → JsvApic/JsvApic.vue} +3 -14
- package/utils/JsViewVueWidget/JsvApic/{index.js → JsvApic/index.js} +2 -4
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/BrowserApic2.vue +116 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/JsvApic2.vue +137 -0
- package/utils/JsViewVueWidget/JsvApic/JsvApic2/index.js +17 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/BrowserApicLib.js +4 -0
- package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/NormalLoopTool.js +16 -18
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/PartLoopTool.js +90 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/SingleLoopTool.js +17 -0
- package/utils/JsViewVueWidget/JsvApic/JsvBrowserApicLib/Viewer.js +111 -0
- package/utils/JsViewVueWidget/JsvApic/JsvCommonLoopToolBase.js +48 -0
- package/utils/JsViewVueWidget/JsvConnectLine/ArcLineManager.js +71 -0
- package/utils/JsViewVueWidget/JsvConnectLine/JsvConnectLine.vue +354 -0
- package/utils/JsViewVueWidget/JsvConnectLine/index.js +2 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ActorControl.ts +37 -18
- package/utils/JsViewVueWidget/JsvFreeMoveActor/ForgeTypeDefine.ts +7 -3
- package/utils/JsViewVueWidget/JsvFreeMoveActor/FreeMoveActor.vue +28 -2
- package/utils/JsViewVueWidget/JsvFreeMoveActor/JsvEnvBlocker.vue +12 -5
- package/utils/JsViewVueWidget/JsvFreeMoveActor/NexusNode.ts +21 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetAction.ts +47 -59
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetCondition.ts +129 -12
- package/utils/JsViewVueWidget/JsvFreeMoveActor/SetState.ts +45 -0
- package/utils/JsViewVueWidget/JsvFreeMoveActor/index.js +10 -2
- package/utils/JsViewVueWidget/JsvGrid.vue +1 -1
- package/utils/JsViewVueWidget/JsvHole.js +1 -1
- package/utils/JsViewVueWidget/JsvInput/JsvInput.vue +1 -1
- package/utils/JsViewVueWidget/JsvLine/JsvLine.vue +2 -2
- package/utils/JsViewVueWidget/JsvLine/LineManager.js +6 -4
- package/utils/JsViewVueWidget/JsvMarquee.vue +7 -4
- package/utils/JsViewVueWidget/JsvPieChart.vue +1 -1
- package/utils/JsViewVueWidget/JsvPreload/JsvPreload.vue +1 -1
- package/utils/JsViewVueWidget/JsvPreload/index.js +1 -1
- package/utils/JsViewVueWidget/JsvProgressBar.vue +172 -0
- package/utils/JsViewVueWidget/JsvQrcode/JsvQrcode.vue +0 -1
- package/utils/JsViewVueWidget/JsvQrcode/index.js +1 -1
- package/utils/JsViewVueWidget/JsvRadarChart.vue +1 -1
- package/utils/JsViewVueWidget/JsvScaleTextBox.vue +0 -2
- package/utils/JsViewVueWidget/JsvSector.vue +1 -1
- package/utils/JsViewVueWidget/JsvSoundPool.js +1 -1
- package/utils/JsViewVueWidget/JsvSpray/index.js +1 -1
- package/utils/JsViewVueWidget/JsvSpriteAnim/FrameBuidler.ts +235 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteAnim.vue +433 -401
- package/utils/JsViewVueWidget/JsvSpriteAnim/JsvSpriteLoader.vue +120 -0
- package/utils/JsViewVueWidget/JsvSpriteAnim/index.js +2 -2
- package/utils/JsViewVueWidget/JsvSwiper/JsvSwiper.vue +5 -5
- package/utils/JsViewVueWidget/JsvSwiper3D/JsvSwiper.vue +425 -422
- package/utils/JsViewVueWidget/JsvVisibleSensor/index.js +1 -1
- package/utils/JsViewVueWidget/index.js +7 -3
- package/utils/index.js +4 -0
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/LoopToolBase.js +0 -25
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/PartLoopTool.js +0 -119
- package/utils/JsViewVueWidget/JsvApic/BrowserApic/Viewer.js +0 -106
- /package/utils/JsViewPlugin/JsvLatex/{JsvLatexBrowser.vue → BrowserJsvLatex.vue} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser-0.9.vue → BrowserJsvPlayer-0.9.vue} +0 -0
- /package/utils/JsViewPlugin/JsvPlayer/{JsvPlayerBrowser.vue → BrowserJsvPlayer.vue} +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/ApicDataBase.js +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/GifData.js +0 -0
- /package/utils/JsViewVueWidget/JsvApic/{BrowserApic → JsvBrowserApicLib}/WebpData.js +0 -0
|
@@ -11,6 +11,7 @@ import { GroupType_ActionAssoc } from "./ForgeTypeDefine"
|
|
|
11
11
|
import CallbackManager from "./CallbackManager";
|
|
12
12
|
import ActionRefObject from "./ActionRefObject";
|
|
13
13
|
import ActorState from "./ActorState";
|
|
14
|
+
import { NexusNode } from "./NexusNode";
|
|
14
15
|
|
|
15
16
|
const ConditionCmdCreator = (
|
|
16
17
|
builderThis: ActorPackBuilder,
|
|
@@ -46,15 +47,15 @@ const ConditionCmdCreator = (
|
|
|
46
47
|
return StateCmdBuilder.NewCondition(conditionSet);
|
|
47
48
|
}
|
|
48
49
|
|
|
49
|
-
const
|
|
50
|
+
const ActOnNexusEvent = (
|
|
50
51
|
builderThis: ActorPackBuilder,
|
|
51
|
-
|
|
52
|
+
nexusId: number,
|
|
52
53
|
eventType: number,
|
|
53
54
|
acts: Array<Object> | null,
|
|
54
55
|
isFinal: boolean,
|
|
55
56
|
callback: Function): Object => {
|
|
56
57
|
return ConditionCmdCreator(builderThis, (commonInfo: Object) => {
|
|
57
|
-
return ConditionSetBuilder.
|
|
58
|
+
return ConditionSetBuilder.OnNexusEvent(nexusId, eventType, commonInfo);
|
|
58
59
|
}, acts, isFinal, callback)
|
|
59
60
|
}
|
|
60
61
|
|
|
@@ -103,10 +104,11 @@ class ActorPackBuilder {
|
|
|
103
104
|
|
|
104
105
|
private _SpeedKeeps: number;
|
|
105
106
|
private _AccKeeps: number;
|
|
106
|
-
private
|
|
107
|
+
private _NexusRecv: NexusNode | null;
|
|
107
108
|
private _CommonInfoValid: boolean;
|
|
109
|
+
private _ContorlSlefNexus: NexusNode;
|
|
108
110
|
|
|
109
|
-
constructor(callbackManager: CallbackManager) {
|
|
111
|
+
constructor(callbackManager: CallbackManager, selfNexus: NexusNode) {
|
|
110
112
|
this._CallbackManager = callbackManager;
|
|
111
113
|
|
|
112
114
|
this._ActionTokenGen = 1; // 自累加的token分发器, 预留0作为无效值判断
|
|
@@ -114,35 +116,27 @@ class ActorPackBuilder {
|
|
|
114
116
|
// 下一个Act指令时所保留的状态
|
|
115
117
|
this._SpeedKeeps = 0;
|
|
116
118
|
this._AccKeeps = 0;
|
|
117
|
-
this.
|
|
119
|
+
this._NexusRecv = null;
|
|
118
120
|
this._CommonInfoValid = false;
|
|
121
|
+
this._ContorlSlefNexus = selfNexus;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
isInUsing() {
|
|
125
|
+
return this._CommonInfoValid;
|
|
119
126
|
}
|
|
120
127
|
|
|
121
128
|
public updateCommonInfo(
|
|
122
129
|
xySpdEnables: number,
|
|
123
130
|
xyAccEnables: number,
|
|
124
|
-
|
|
131
|
+
nexusRecv: NexusNode | null
|
|
125
132
|
) {
|
|
126
133
|
this._SpeedKeeps = xySpdEnables;
|
|
127
134
|
this._AccKeeps = xyAccEnables;
|
|
128
|
-
this.
|
|
129
|
-
|
|
130
|
-
// 如果有refobj,则分发token
|
|
131
|
-
this._InitActRefObj(this._RefObj);
|
|
135
|
+
this._NexusRecv = nexusRecv;
|
|
132
136
|
|
|
133
137
|
this._CommonInfoValid = true;
|
|
134
138
|
}
|
|
135
139
|
|
|
136
|
-
private _InitActRefObj(refObj: ActionRefObject | null) {
|
|
137
|
-
if (refObj) {
|
|
138
|
-
if (refObj.used) {
|
|
139
|
-
console.warn("Warn: actRef be overrided, old token=" + refObj.token);
|
|
140
|
-
}
|
|
141
|
-
refObj.token = this._ActionTokenGen++;
|
|
142
|
-
refObj.used = false;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
140
|
private _CheckCommonInfo(): boolean {
|
|
147
141
|
if (!this._CommonInfoValid) {
|
|
148
142
|
console.error("Error: must call from new action()");
|
|
@@ -190,20 +184,20 @@ class ActorPackBuilder {
|
|
|
190
184
|
}
|
|
191
185
|
|
|
192
186
|
/**
|
|
193
|
-
* moveTo
|
|
187
|
+
* moveTo 以给定速度移动, 知道边界满足
|
|
194
188
|
*
|
|
195
|
-
* @param {int}
|
|
196
|
-
* @param {int}
|
|
189
|
+
* @param {int} edgeX 带符号整数,标识运动的边界位置,相对于Actor原始位置, 如果设置为undefined, 则表示该轴不设目标
|
|
190
|
+
* @param {int} edgeY 带符号整数,标识运动的边界位置,相对于Actor原始位置, 如果设置为undefined, 则表示该轴不设目标
|
|
197
191
|
* @param {double} xSpeed 运行速度,使用时会自动取绝对值,单位(pixel/帧),
|
|
198
|
-
* undefined时,若
|
|
192
|
+
* undefined时,若edgeX设置, 则把edge作为运动目标,以另一轴速度反推此速度, 否则不改变该轴速度
|
|
199
193
|
* @param {double} ySpeed 运行速度,使用时会自动取绝对值,单位(pixel/帧)
|
|
200
|
-
* undefined时,若targetY设置,
|
|
194
|
+
* undefined时,若targetY设置, 则把edge作为运动目标,以另一轴速度反推此速度, 否则不改变该轴速度
|
|
201
195
|
* @param {function} endCallback 参数(x, y) 运动到目标位置后的回调函数, x或者y达到后即回调,以先到为准,回报当前Actor的相对于原始位置的x,y
|
|
202
196
|
* @return CommandPack(放入run或者then的CmdPackList队列)
|
|
203
197
|
*/
|
|
204
198
|
public moveTo(
|
|
205
|
-
|
|
206
|
-
|
|
199
|
+
edgeX: number | undefined,
|
|
200
|
+
edgeY: number | undefined,
|
|
207
201
|
xSpeed: number | undefined,
|
|
208
202
|
ySpeed: number | undefined,
|
|
209
203
|
endCallback: Function | null = null
|
|
@@ -225,15 +219,15 @@ class ActorPackBuilder {
|
|
|
225
219
|
let cmdList: Array<Object> = [];
|
|
226
220
|
|
|
227
221
|
// 设置运动速度
|
|
228
|
-
cmdList.push(ActionCmdBuilder.SetArrowSpeed(
|
|
222
|
+
cmdList.push(ActionCmdBuilder.SetArrowSpeed(edgeX, edgeY, xSpeed, ySpeed));
|
|
229
223
|
|
|
230
224
|
// 设置达到目标位置的condition
|
|
231
225
|
cmdList.push(
|
|
232
226
|
ActOnReachPosition(
|
|
233
227
|
this,
|
|
234
|
-
|
|
228
|
+
edgeX, edgeY,
|
|
235
229
|
[ActionCmdBuilder.StopMovingExact(),
|
|
236
|
-
this.
|
|
230
|
+
this._NexusRecv ? StateCmdBuilder.FireNexusEvent(ActEventDefine.ActFinish, this._NexusRecv.token) : null
|
|
237
231
|
],
|
|
238
232
|
true,
|
|
239
233
|
endCallback ? (actorState: ActorState) => {
|
|
@@ -244,7 +238,7 @@ class ActorPackBuilder {
|
|
|
244
238
|
|
|
245
239
|
//return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, cmdList);
|
|
246
240
|
|
|
247
|
-
let c = CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
241
|
+
let c = CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
248
242
|
return c;
|
|
249
243
|
}
|
|
250
244
|
|
|
@@ -276,7 +270,7 @@ class ActorPackBuilder {
|
|
|
276
270
|
if (isNaN(spreadFrame as number) || spreadFrame == 0) {
|
|
277
271
|
// 经历的帧数为0, 即为立即变速
|
|
278
272
|
cmdList.push(ActionCmdBuilder.SetSpeed(xSpeed, ySpeed));
|
|
279
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
273
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
280
274
|
} else {
|
|
281
275
|
// 均匀变速逻辑
|
|
282
276
|
cmdList.push(ActionCmdBuilder.AltSpeed(xSpeed, ySpeed, spreadFrame));
|
|
@@ -287,7 +281,7 @@ class ActorPackBuilder {
|
|
|
287
281
|
this,
|
|
288
282
|
xSpeed, ySpeed,
|
|
289
283
|
[ActionCmdBuilder.ResetAcc(0, 0),
|
|
290
|
-
this.
|
|
284
|
+
this._NexusRecv ? StateCmdBuilder.FireNexusEvent(ActEventDefine.ActFinish, this._NexusRecv.token) : null
|
|
291
285
|
],
|
|
292
286
|
true, // isFinal
|
|
293
287
|
finishCallback ? (actorState: ActorState) => {
|
|
@@ -296,7 +290,7 @@ class ActorPackBuilder {
|
|
|
296
290
|
)
|
|
297
291
|
)
|
|
298
292
|
|
|
299
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
293
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
300
294
|
}
|
|
301
295
|
}
|
|
302
296
|
|
|
@@ -320,11 +314,10 @@ class ActorPackBuilder {
|
|
|
320
314
|
// 3. 当收到 ActFinish, 回调callback,标识动作完成
|
|
321
315
|
// 特别注意: 存在有可能以当前speed无法到达target的情况,此时由native判断出,
|
|
322
316
|
|
|
323
|
-
if (!this.
|
|
317
|
+
if (!this._NexusRecv) {
|
|
324
318
|
// 此动作的结束由native来判断和决定
|
|
325
319
|
// 要跟踪native的 ActFinish 事件
|
|
326
|
-
this.
|
|
327
|
-
this._InitActRefObj(this._RefObj);
|
|
320
|
+
this._NexusRecv = this._ContorlSlefNexus;
|
|
328
321
|
}
|
|
329
322
|
|
|
330
323
|
if (!this._BasicPreProcess("brakeToPosition")) {
|
|
@@ -343,9 +336,9 @@ class ActorPackBuilder {
|
|
|
343
336
|
|
|
344
337
|
// 创建结束ConditionSet(ActFinish)
|
|
345
338
|
cmdList.push(
|
|
346
|
-
|
|
339
|
+
ActOnNexusEvent(
|
|
347
340
|
this,
|
|
348
|
-
this.
|
|
341
|
+
this._NexusRecv.token,
|
|
349
342
|
ActEventDefine.ActFinish,
|
|
350
343
|
null,
|
|
351
344
|
true,
|
|
@@ -357,9 +350,9 @@ class ActorPackBuilder {
|
|
|
357
350
|
|
|
358
351
|
// 创建结束ConditionSet(ActReject)
|
|
359
352
|
cmdList.push(
|
|
360
|
-
|
|
353
|
+
ActOnNexusEvent(
|
|
361
354
|
this,
|
|
362
|
-
this.
|
|
355
|
+
this._NexusRecv.token,
|
|
363
356
|
ActEventDefine.ActReject,
|
|
364
357
|
null,
|
|
365
358
|
true,
|
|
@@ -369,7 +362,7 @@ class ActorPackBuilder {
|
|
|
369
362
|
)
|
|
370
363
|
);
|
|
371
364
|
|
|
372
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
365
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
373
366
|
}
|
|
374
367
|
|
|
375
368
|
|
|
@@ -392,7 +385,7 @@ class ActorPackBuilder {
|
|
|
392
385
|
let cmdList: Array<Object> = [];
|
|
393
386
|
cmdList.push(ActionCmdBuilder.SetSpeed(spdX, spdY));
|
|
394
387
|
|
|
395
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
388
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
396
389
|
}
|
|
397
390
|
|
|
398
391
|
/*
|
|
@@ -422,9 +415,9 @@ class ActorPackBuilder {
|
|
|
422
415
|
cmdList.push(ActionCmdBuilder.SetAccel(accelX, accelY));
|
|
423
416
|
|
|
424
417
|
// 创建拐点的condition回调
|
|
425
|
-
this._BuildAccelOnPole(this, cmdList, this.
|
|
418
|
+
this._BuildAccelOnPole(this, cmdList, this._NexusRecv, onRevertX, onRevertY);
|
|
426
419
|
|
|
427
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
420
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
428
421
|
}
|
|
429
422
|
|
|
430
423
|
/*
|
|
@@ -463,9 +456,9 @@ class ActorPackBuilder {
|
|
|
463
456
|
cmdList.push(ActionCmdBuilder.SetAccel(accelX, accelY));
|
|
464
457
|
|
|
465
458
|
// 创建拐点的condition回调
|
|
466
|
-
this._BuildAccelOnPole(this, cmdList, this.
|
|
459
|
+
this._BuildAccelOnPole(this, cmdList, this._NexusRecv, onRevertX, onRevertY);
|
|
467
460
|
|
|
468
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
461
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
469
462
|
}
|
|
470
463
|
|
|
471
464
|
/*
|
|
@@ -483,17 +476,17 @@ class ActorPackBuilder {
|
|
|
483
476
|
let cmdList: Array<Object> = [];
|
|
484
477
|
cmdList.push(isExact ? ActionCmdBuilder.StopMovingExact() : ActionCmdBuilder.StopMoving());
|
|
485
478
|
|
|
486
|
-
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
479
|
+
return CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
487
480
|
}
|
|
488
481
|
|
|
489
482
|
_BuildAccelOnPole(
|
|
490
483
|
builderThis: ActorPackBuilder,
|
|
491
484
|
cmdList: Array<Object>,
|
|
492
|
-
|
|
485
|
+
nexusRecv: NexusNode | null,
|
|
493
486
|
onRevertX: Function | null,
|
|
494
487
|
onRevertY: Function | null
|
|
495
488
|
) {
|
|
496
|
-
if (
|
|
489
|
+
if (nexusRecv || onRevertX || onRevertY) {
|
|
497
490
|
// RefObj: 外界可能希望了解速度拐点的ActEvent
|
|
498
491
|
// onRevertX || onRevertY: 通过callback希望了解速度拐点信息
|
|
499
492
|
|
|
@@ -502,7 +495,7 @@ class ActorPackBuilder {
|
|
|
502
495
|
ActOnGetAcrossSpeed(
|
|
503
496
|
builderThis,
|
|
504
497
|
0, undefined,
|
|
505
|
-
[
|
|
498
|
+
[nexusRecv ? StateCmdBuilder.FireNexusEvent(ActEventDefine.SpeedRevertX, nexusRecv.token) : null],
|
|
506
499
|
false, // isFinal
|
|
507
500
|
onRevertX ? () => {
|
|
508
501
|
onRevertX();
|
|
@@ -515,7 +508,7 @@ class ActorPackBuilder {
|
|
|
515
508
|
ActOnGetAcrossSpeed(
|
|
516
509
|
builderThis,
|
|
517
510
|
undefined, 0,
|
|
518
|
-
[
|
|
511
|
+
[nexusRecv ? StateCmdBuilder.FireNexusEvent(ActEventDefine.SpeedRevertY, nexusRecv.token) : null],
|
|
519
512
|
false, // isFinal
|
|
520
513
|
onRevertY ? () => {
|
|
521
514
|
onRevertY();
|
|
@@ -531,11 +524,6 @@ class ActorPackBuilder {
|
|
|
531
524
|
return false;
|
|
532
525
|
}
|
|
533
526
|
this._CommonInfoValid = false;
|
|
534
|
-
|
|
535
|
-
if (this._RefObj) {
|
|
536
|
-
this._RefObj.used = true;
|
|
537
|
-
}
|
|
538
|
-
|
|
539
527
|
return true;
|
|
540
528
|
}
|
|
541
529
|
|
|
@@ -545,7 +533,7 @@ class ActorPackBuilder {
|
|
|
545
533
|
// 传送动作
|
|
546
534
|
cmdList.push(ActionCmdBuilder.TeleportTo(x, y, isOffset));
|
|
547
535
|
|
|
548
|
-
let c = CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this.
|
|
536
|
+
let c = CmdPackBuilder.InitActCmdPack(this._SpeedKeeps, this._AccKeeps, this._NexusRecv?.token, cmdList);
|
|
549
537
|
return c;
|
|
550
538
|
}
|
|
551
539
|
}
|
|
@@ -8,6 +8,9 @@
|
|
|
8
8
|
import ActionRefObject from "./ActionRefObject";
|
|
9
9
|
import CallbackManager from "./CallbackManager";
|
|
10
10
|
import { ConditionSetBuilder, StateCmdBuilder, CmdPackBuilder } from "./ForgeTypeDefine"
|
|
11
|
+
import { NexusNode } from "./NexusNode";
|
|
12
|
+
|
|
13
|
+
type UNumber = undefined | number;
|
|
11
14
|
|
|
12
15
|
const setChildCommnadPackList = (conditionSet: Object, callbackManager: CallbackManager, cmdPackList: Array<Object>) => {
|
|
13
16
|
for (let i = 0; i < cmdPackList.length; i++) {
|
|
@@ -21,19 +24,32 @@ const setChildCommnadPackList = (conditionSet: Object, callbackManager: Callback
|
|
|
21
24
|
ConditionSetBuilder.SetCmdPackList(conditionSet, cmdPackList);
|
|
22
25
|
}
|
|
23
26
|
|
|
27
|
+
type WallDirection = "left" | "right" | "top" | "bottom";
|
|
28
|
+
|
|
24
29
|
class ConditionPackBuilder {
|
|
25
30
|
public _Callbacks: CallbackManager;
|
|
26
31
|
private _CommonInfo: Object;
|
|
27
32
|
private _CommonInfoValid: boolean;
|
|
33
|
+
private _ContorlSlefNexus: NexusNode;
|
|
28
34
|
|
|
29
|
-
constructor(callbackManager) {
|
|
35
|
+
constructor(callbackManager: CallbackManager, selfNexus: NexusNode) {
|
|
30
36
|
this._Callbacks = callbackManager;
|
|
31
37
|
this._CommonInfo = ConditionSetBuilder.InitCommonInfo();
|
|
32
38
|
this._CommonInfoValid = false;
|
|
39
|
+
this._ContorlSlefNexus = selfNexus;
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
isInUsing() {
|
|
43
|
+
return this._CommonInfoValid;
|
|
33
44
|
}
|
|
34
45
|
|
|
35
|
-
updateCommandInfo(
|
|
36
|
-
|
|
46
|
+
updateCommandInfo(
|
|
47
|
+
group: number,
|
|
48
|
+
multiTimes: boolean,
|
|
49
|
+
specName: string | null,
|
|
50
|
+
shoudRenderBreak: boolean
|
|
51
|
+
) {
|
|
52
|
+
ConditionSetBuilder.UpdateCommonInfo(this._CommonInfo, group, multiTimes, specName, shoudRenderBreak);
|
|
37
53
|
this._CommonInfoValid = true;
|
|
38
54
|
}
|
|
39
55
|
|
|
@@ -55,6 +71,32 @@ class ConditionPackBuilder {
|
|
|
55
71
|
return this._BuildPack(ConditionSetBuilder.ReachPosition(xPosition, yPosition, this._CommonInfo));
|
|
56
72
|
}
|
|
57
73
|
|
|
74
|
+
/**
|
|
75
|
+
* reachPosition
|
|
76
|
+
* 获取 ReachPosition 的condition
|
|
77
|
+
* x或y已经处于,或者被越过时触发
|
|
78
|
+
*
|
|
79
|
+
* @param {double} xPosition 位置有效值,可以传入undefined来决定此值不设置
|
|
80
|
+
* @param {double} yPosition 位置有效值,可以传入undefined来决定此值不设置
|
|
81
|
+
*/
|
|
82
|
+
wallPosition(direction: WallDirection, xPosition: UNumber, yPosition: UNumber): object | null {
|
|
83
|
+
if (!this._CheckCommonInfo()) {
|
|
84
|
+
return null;
|
|
85
|
+
}
|
|
86
|
+
this._CommonInfoValid = false;
|
|
87
|
+
|
|
88
|
+
return this._BuildPack(ConditionSetBuilder.WallPosition(direction, xPosition, yPosition, this._CommonInfo));
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
boxPosition(left: UNumber, top: UNumber, right: UNumber, bottom: UNumber): object | null {
|
|
92
|
+
if (!this._CheckCommonInfo()) {
|
|
93
|
+
return null;
|
|
94
|
+
}
|
|
95
|
+
this._CommonInfoValid = false;
|
|
96
|
+
|
|
97
|
+
return this._BuildPack(ConditionSetBuilder.BoxPosition(left, top, right, bottom, this._CommonInfo));
|
|
98
|
+
}
|
|
99
|
+
|
|
58
100
|
/**
|
|
59
101
|
* AcrossPosition
|
|
60
102
|
* 获取 AcrossPosition 的condition
|
|
@@ -74,26 +116,26 @@ class ConditionPackBuilder {
|
|
|
74
116
|
}
|
|
75
117
|
|
|
76
118
|
/**
|
|
77
|
-
*
|
|
119
|
+
* OnNexusEvent
|
|
78
120
|
* 响应 actRef 关联的 action 所发出的内部状态信息
|
|
79
121
|
*
|
|
80
|
-
* @param {
|
|
81
|
-
* @param {
|
|
122
|
+
* @param {NexusNode} nexusRecv 一个进行Action时传给action的空的{}, 内容被action内部填写
|
|
123
|
+
* @param {number} detailEventType 监听的事件类型
|
|
82
124
|
*/
|
|
83
|
-
|
|
125
|
+
onNexusEvent(nexusRecv: NexusNode, detailEventType: number): Object | null {
|
|
84
126
|
// CommonInfo 只能使用一次,规避多次使用问题
|
|
85
127
|
if (!this._CheckCommonInfo()) {
|
|
86
128
|
return null;
|
|
87
129
|
}
|
|
88
130
|
this._CommonInfoValid = false;
|
|
89
131
|
|
|
90
|
-
if (isNaN(
|
|
132
|
+
if (isNaN(nexusRecv?.token) || isNaN(detailEventType)) {
|
|
91
133
|
// 类型不符合
|
|
92
|
-
console.error("
|
|
134
|
+
console.error("onNexusEvent params error", nexusRecv, detailEventType);
|
|
93
135
|
return null;
|
|
94
136
|
}
|
|
95
137
|
|
|
96
|
-
return this._BuildPack(ConditionSetBuilder.
|
|
138
|
+
return this._BuildPack(ConditionSetBuilder.OnNexusEvent(nexusRecv.token, detailEventType, this._CommonInfo));
|
|
97
139
|
}
|
|
98
140
|
|
|
99
141
|
/**
|
|
@@ -101,9 +143,9 @@ class ConditionPackBuilder {
|
|
|
101
143
|
* 监听Actor关联的LayoutView与blocker碰撞的状态
|
|
102
144
|
* 碰撞发生后,可以 State.revertWithHitBlock 将LayoutView返回到紧贴到碰撞点的状态
|
|
103
145
|
*
|
|
104
|
-
* @param {
|
|
146
|
+
* @param {number} blkGID 想监听的blocker集群的组ID, 例如所有的跳板横向碰撞面,或者所有的跳板边缘的纵向碰撞面, 0为无效值
|
|
105
147
|
*/
|
|
106
|
-
|
|
148
|
+
onHitBlock(blkGID: number) {
|
|
107
149
|
// CommonInfo 只能使用一次,规避多次使用问题
|
|
108
150
|
if (!this._CheckCommonInfo()) {
|
|
109
151
|
return null;
|
|
@@ -113,6 +155,81 @@ class ConditionPackBuilder {
|
|
|
113
155
|
return this._BuildPack(ConditionSetBuilder.OnHitBlock(blkGID, this._CommonInfo));
|
|
114
156
|
}
|
|
115
157
|
|
|
158
|
+
/**
|
|
159
|
+
* onNextTick
|
|
160
|
+
* 用于对一些Condition激活进行延迟,例如teleportTo处理后延迟激活 OnHitBlock 动作,规避teleportTo处理直接触发OnHitBlocker
|
|
161
|
+
*
|
|
162
|
+
*/
|
|
163
|
+
onNextTick(tickGap: number = 1) {
|
|
164
|
+
// CommonInfo 只能使用一次,规避多次使用问题
|
|
165
|
+
if (!this._CheckCommonInfo()) {
|
|
166
|
+
return null;
|
|
167
|
+
}
|
|
168
|
+
this._CommonInfoValid = false;
|
|
169
|
+
if (tickGap <= 0) {
|
|
170
|
+
tickGap = 1;
|
|
171
|
+
}
|
|
172
|
+
|
|
173
|
+
return this._BuildPack(ConditionSetBuilder.OnNextTick(tickGap, this._CommonInfo));
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
onDragStart() {
|
|
177
|
+
if (!this._CheckCommonInfo()) {
|
|
178
|
+
return null;
|
|
179
|
+
}
|
|
180
|
+
this._CommonInfoValid = false;
|
|
181
|
+
|
|
182
|
+
return this._BuildPack(ConditionSetBuilder.OnDragStart(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
onDragEnd() {
|
|
186
|
+
if (!this._CheckCommonInfo()) {
|
|
187
|
+
return null;
|
|
188
|
+
}
|
|
189
|
+
this._CommonInfoValid = false;
|
|
190
|
+
return this._BuildPack(ConditionSetBuilder.OnDragEnd(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
191
|
+
}
|
|
192
|
+
|
|
193
|
+
onTouchDown() {
|
|
194
|
+
if (!this._CheckCommonInfo()) {
|
|
195
|
+
return null;
|
|
196
|
+
}
|
|
197
|
+
this._CommonInfoValid = false;
|
|
198
|
+
return this._BuildPack(ConditionSetBuilder.OnTouchDown(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
onTouchRelease() {
|
|
202
|
+
if (!this._CheckCommonInfo()) {
|
|
203
|
+
return null;
|
|
204
|
+
}
|
|
205
|
+
this._CommonInfoValid = false;
|
|
206
|
+
return this._BuildPack(ConditionSetBuilder.OnTouchRelease(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
onFlingStart() {
|
|
210
|
+
if (!this._CheckCommonInfo()) {
|
|
211
|
+
return null;
|
|
212
|
+
}
|
|
213
|
+
this._CommonInfoValid = false;
|
|
214
|
+
return this._BuildPack(ConditionSetBuilder.OnFlingStart(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
215
|
+
}
|
|
216
|
+
|
|
217
|
+
onFlingProgress() {
|
|
218
|
+
if (!this._CheckCommonInfo()) {
|
|
219
|
+
return null;
|
|
220
|
+
}
|
|
221
|
+
this._CommonInfoValid = false;
|
|
222
|
+
return this._BuildPack(ConditionSetBuilder.OnFlingProgress(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
223
|
+
}
|
|
224
|
+
|
|
225
|
+
onFlingEnd() {
|
|
226
|
+
if (!this._CheckCommonInfo()) {
|
|
227
|
+
return null;
|
|
228
|
+
}
|
|
229
|
+
this._CommonInfoValid = false;
|
|
230
|
+
return this._BuildPack(ConditionSetBuilder.OnFlingEnd(this._CommonInfo, this._ContorlSlefNexus.token));
|
|
231
|
+
}
|
|
232
|
+
|
|
116
233
|
_CheckCommonInfo(): boolean {
|
|
117
234
|
if (!this._CommonInfoValid) {
|
|
118
235
|
console.error("Error: must call from new conditoin()");
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
|
|
2
2
|
import { StateCmdBuilder, CmdPackBuilder } from "./ForgeTypeDefine"
|
|
3
|
+
import { NexusNode } from "./NexusNode";
|
|
3
4
|
|
|
4
5
|
class StatePackBuilder {
|
|
5
6
|
constructor() {
|
|
@@ -14,6 +15,39 @@ class StatePackBuilder {
|
|
|
14
15
|
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.RemoveAllCondtions());
|
|
15
16
|
}
|
|
16
17
|
|
|
18
|
+
/*
|
|
19
|
+
* removeConditionByGroup
|
|
20
|
+
* 清理指定组的condition
|
|
21
|
+
*/
|
|
22
|
+
removeConditionByGroup(group: number): Object {
|
|
23
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.RemoveByGroup(group));
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* activeCondition
|
|
28
|
+
* 重新激活对应gid或者specName的condition
|
|
29
|
+
* 一个condition处于非激活有两种可能,
|
|
30
|
+
* 1. 允许触发一次的condition已经完成触发
|
|
31
|
+
* 2. 被DeactiveCondition关闭过的condition
|
|
32
|
+
*
|
|
33
|
+
* @param {int} groupType (可选)对应condition的groupType, 与specName二选一
|
|
34
|
+
* @param {String} specName (可选)对应condition的specName, 与groupId二选一, 当groupId为 undefined 或 -1 时生效
|
|
35
|
+
*/
|
|
36
|
+
activeCondition(groupType: number | undefined, specName: String | undefined): Object {
|
|
37
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.ActiveCondition(groupType, specName));
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* deactiveCondition
|
|
42
|
+
* 停止对应gid或者specName的condition
|
|
43
|
+
*
|
|
44
|
+
* @param {int} groupType (可选)对应condition的groupType, 与specName二选一
|
|
45
|
+
* @param {String} specName (可选)对应condition的specName, 与groupId二选一, 当groupId为 undefined 或 -1 时生效
|
|
46
|
+
*/
|
|
47
|
+
deactiveCondition(groupType: number | undefined, specName: String | undefined): Object {
|
|
48
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.DeactiveCondition(groupType, specName));
|
|
49
|
+
}
|
|
50
|
+
|
|
17
51
|
/*
|
|
18
52
|
* setStartPos 立刻将actor运动起始点设置到目标位置, 作为下一个Action执行时的位置起点
|
|
19
53
|
* 注意1: 只影响当speed/accel不为0时的下一帧的运动起始位置,
|
|
@@ -48,6 +82,17 @@ class StatePackBuilder {
|
|
|
48
82
|
revertWithHitBlock() {
|
|
49
83
|
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.RevertWithHitBlock());
|
|
50
84
|
}
|
|
85
|
+
|
|
86
|
+
setHitWallOverflow() {
|
|
87
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.SetHitWallOverflow());
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/*
|
|
91
|
+
* fireNexusEvent 发出Nexus event
|
|
92
|
+
*/
|
|
93
|
+
fireNexusEvent(nexusRecv: NexusNode, detailEventType: number) {
|
|
94
|
+
return CmdPackBuilder.InitStateCmdPack(StateCmdBuilder.FireNexusEvent(detailEventType, nexusRecv.token));
|
|
95
|
+
}
|
|
51
96
|
}
|
|
52
97
|
|
|
53
98
|
export default StatePackBuilder;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
1
|
import JsvFreeMoveActor from "./FreeMoveActor.vue";
|
|
2
2
|
import { ActEventDefine } from "./ForgeTypeDefine.ts"
|
|
3
3
|
import { default as KeepFlags } from "./KeepFlags.ts"
|
|
4
|
+
import JsvEnvBlocker from "./JsvEnvBlocker.vue"
|
|
5
|
+
import { newNexus } from "./NexusNode"
|
|
4
6
|
|
|
5
7
|
let FreeMoveDef = {
|
|
6
8
|
ActEventDefine,
|
|
7
|
-
KeepFlags
|
|
9
|
+
KeepFlags,
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
let FreeMoveFunc = {
|
|
13
|
+
newNexus,
|
|
8
14
|
}
|
|
9
15
|
|
|
10
16
|
export {
|
|
11
17
|
JsvFreeMoveActor,
|
|
12
|
-
|
|
18
|
+
JsvEnvBlocker,
|
|
19
|
+
FreeMoveDef,
|
|
20
|
+
FreeMoveFunc
|
|
13
21
|
}
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
* @Description: file content
|
|
6
6
|
-->
|
|
7
7
|
<script>
|
|
8
|
-
import { EdgeDirection } from "
|
|
8
|
+
import { EdgeDirection } from "../../JsViewEngineWidget";
|
|
9
9
|
import { Forge } from "@shijiu/jsview/dom/jsv-forge-define";
|
|
10
10
|
import CursorVue from "./Cursor.vue";
|
|
11
11
|
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
* 【模块 export 内容】
|
|
3
3
|
* JsvLine:Vue高阶组件,用于划线。支持横线、竖线和斜线。
|
|
4
|
-
* props说明:
|
|
4
|
+
* props说明:(注意:全部属性非响应式, 需要变更时用 key 来触发重绘)
|
|
5
5
|
* startPos {Object} (必填) 起始位置,属性:x,y
|
|
6
6
|
* endPos {Object} (必填) 结束位置, 属性:x,y
|
|
7
7
|
* lineWidth {Number} (必填) 线条的粗细程度
|
|
8
8
|
* appear {String} 线条的出现方式 fadeIn 淡入 / fadeOut 淡出
|
|
9
9
|
* backgroundImage {String} 背景图片
|
|
10
10
|
* backgroundColor {String} 背景颜色,默认值:白色#FFFFFF
|
|
11
|
-
* borderRadius {Number}
|
|
11
|
+
* borderRadius {Number} 圆角半径
|
|
12
12
|
*
|
|
13
13
|
-->
|
|
14
14
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { JsvTextureStoreApi } from "
|
|
1
|
+
import { JsvTextureStoreApi } from "../../JsViewVueTools";
|
|
2
2
|
|
|
3
3
|
let sMap = new Map();
|
|
4
4
|
|
|
@@ -30,17 +30,20 @@ const createTexture = (lineWidth, color) => {
|
|
|
30
30
|
|
|
31
31
|
class LineTexture {
|
|
32
32
|
constructor(lineWidth, color) {
|
|
33
|
+
this.key = `${lineWidth}${color}`
|
|
34
|
+
if (lineWidth < 8) {
|
|
35
|
+
lineWidth = 8
|
|
36
|
+
}
|
|
33
37
|
this.bitmap = {
|
|
34
38
|
width: 2,
|
|
35
39
|
height: lineWidth + 2
|
|
36
40
|
}
|
|
37
|
-
this.key = `${lineWidth}${color}`
|
|
38
41
|
this.count = 0
|
|
39
42
|
this.newLineWidth = Math.floor(lineWidth / 2);
|
|
40
43
|
//画布
|
|
41
44
|
this.canvasTexture = JsvTextureStoreApi.canvasTexture(this.bitmap.width, this.bitmap.height)
|
|
42
45
|
//绘画
|
|
43
|
-
this.canvasTexture.drawLine(-1,this.newLineWidth + 1, 3,this.newLineWidth + 1, lineWidth, color);
|
|
46
|
+
this.canvasTexture.drawLine(-1, this.newLineWidth + 1, 3, this.newLineWidth + 1, lineWidth, color);
|
|
44
47
|
//sourceId赋值
|
|
45
48
|
this.sourceId = this.canvasTexture.commit();
|
|
46
49
|
}
|
|
@@ -56,7 +59,6 @@ class LineTexture {
|
|
|
56
59
|
JsvTextureStoreApi.deleteTexture(this.sourceId);
|
|
57
60
|
sMap.delete(this.key)
|
|
58
61
|
}
|
|
59
|
-
console.log(sMap);
|
|
60
62
|
}
|
|
61
63
|
}
|
|
62
64
|
export { createTexture };
|