@shijiu/jsview-vue-samples 2.1.428 → 2.1.435
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/DemoHomepage/router.js +8 -8
- package/SceneTransition/App.vue +237 -146
- package/SceneTransition/JsvSceneTransition.vue +90 -104
- package/SceneTransition/maskConfig/config1.js +101 -0
- package/SceneTransition/maskConfig/config2.js +88 -0
- package/SceneTransition/maskConfig/config3.js +102 -0
- package/TextureStoreTest/App.vue +111 -45
- package/package.json +1 -1
- package/SceneTransition/images/fly1.jpg +0 -0
- package/SceneTransition/images/fly2.jpg +0 -0
- package/SceneTransition/images/mask-025/config.json +0 -29
- package/SceneTransition/images/mask-025/res/1.png +0 -0
- package/SceneTransition/images/mask-025/res/2.png +0 -0
- package/SceneTransition/images/mask-025/res/3.png +0 -0
- package/SceneTransition/images/mask-025/res/4.png +0 -0
- package/SceneTransition/images/mask-025/res/icon.png +0 -0
- package/SceneTransition/images/mask-025/res/stroke.png +0 -0
- package/SceneTransition/images/sample.png +0 -0
package/DemoHomepage/router.js
CHANGED
|
@@ -16,11 +16,6 @@ let routeList = [
|
|
|
16
16
|
path: '/feature/Basic',
|
|
17
17
|
component: () => import('jsview-vue-samples/Basic/App.vue'),
|
|
18
18
|
},
|
|
19
|
-
// {
|
|
20
|
-
// name: '场景过渡',
|
|
21
|
-
// path: '/feature/SceneTransition',
|
|
22
|
-
// component: () => import('jsview-vue-samples/SceneTransition/App.vue'),
|
|
23
|
-
// },
|
|
24
19
|
{
|
|
25
20
|
name: 'FlexDemo',
|
|
26
21
|
path: '/feature/FlexDemo',
|
|
@@ -305,14 +300,19 @@ let routeList = [
|
|
|
305
300
|
},
|
|
306
301
|
{
|
|
307
302
|
name: '进度条',
|
|
308
|
-
path: '/
|
|
303
|
+
path: '/Operations/ProgressBar',
|
|
309
304
|
component: () => import('jsview-vue-samples/ProgressBar/App.vue'),
|
|
310
305
|
},
|
|
311
306
|
{
|
|
312
307
|
name: '春联测试',
|
|
313
|
-
path: '/
|
|
308
|
+
path: '/Operations/CoupletsTest',
|
|
314
309
|
component: () => import('jsview-vue-samples/CoupletsTest/App.vue'),
|
|
315
|
-
}
|
|
310
|
+
},
|
|
311
|
+
{
|
|
312
|
+
name: '场景过渡',
|
|
313
|
+
path: '/Operations/SceneTransition',
|
|
314
|
+
component: () => import('jsview-vue-samples/SceneTransition/App.vue'),
|
|
315
|
+
},
|
|
316
316
|
];
|
|
317
317
|
|
|
318
318
|
//添加MetroWidget demo
|
package/SceneTransition/App.vue
CHANGED
|
@@ -1,177 +1,268 @@
|
|
|
1
1
|
<template>
|
|
2
|
-
<JsvPreload
|
|
2
|
+
<JsvPreload
|
|
3
|
+
:preloadList="preload_info"
|
|
4
|
+
:onPreloadDone="loadDone"
|
|
5
|
+
></JsvPreload>
|
|
3
6
|
<jsv-focus-block autoFocus :onKeyDown="onKeyDown">
|
|
4
|
-
<div
|
|
5
|
-
<
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
7
|
+
<div class="bgStyle">
|
|
8
|
+
<div :style="{ width: 640, height: 360, backgroundImage: bg, top: 100 }">
|
|
9
|
+
<JsvSceneTransition
|
|
10
|
+
v-show="isShow"
|
|
11
|
+
:imageUrl="fly1"
|
|
12
|
+
:ArraySet="SelectArray"
|
|
13
|
+
:displayWidth="640"
|
|
14
|
+
:style="style"
|
|
15
|
+
:onOff="onOff"
|
|
16
|
+
></JsvSceneTransition>
|
|
17
|
+
</div>
|
|
13
18
|
<!-- 文字说明 -->
|
|
14
|
-
<div class="text"
|
|
19
|
+
<div class="text" :style="{ left: 20, top: 20 }">
|
|
20
|
+
{{ "操作说明:按【OK】键进行随机遮罩层碎片过渡效果。" }}
|
|
21
|
+
</div>
|
|
22
|
+
<div class="text" :style="{ left: 810, top: 20 }">{{ "素材展示" }}</div>
|
|
23
|
+
<div class="text" :style="{ left: 400, top: 500 }">
|
|
24
|
+
{{ "按需采用碎片式的图片来进行遮罩,此例只展示一组遮罩素材。" }}
|
|
25
|
+
</div>
|
|
26
|
+
<!-- 报错小框 -->
|
|
27
|
+
<div v-if="boxSwitch" class="smallBox">
|
|
28
|
+
<div class="text" :style="{ left: 50, top: 40 }">
|
|
29
|
+
{{ "图片没预加载完成!" }}
|
|
30
|
+
</div>
|
|
31
|
+
</div>
|
|
32
|
+
<!-- 素材展示 -->
|
|
33
|
+
<div
|
|
34
|
+
:style="{
|
|
35
|
+
width: 320,
|
|
36
|
+
height: 180,
|
|
37
|
+
backgroundImage: fly1,
|
|
38
|
+
top: 80,
|
|
39
|
+
left: 700,
|
|
40
|
+
}"
|
|
41
|
+
></div>
|
|
42
|
+
<div
|
|
43
|
+
:style="{
|
|
44
|
+
width: 320,
|
|
45
|
+
height: 180,
|
|
46
|
+
backgroundImage: fly2,
|
|
47
|
+
top: 280,
|
|
48
|
+
left: 700,
|
|
49
|
+
}"
|
|
50
|
+
></div>
|
|
51
|
+
<div
|
|
52
|
+
:style="{
|
|
53
|
+
width: 100,
|
|
54
|
+
height: 60,
|
|
55
|
+
backgroundImage: ArraySet1[0].url,
|
|
56
|
+
top: 500,
|
|
57
|
+
left: 700,
|
|
58
|
+
}"
|
|
59
|
+
></div>
|
|
60
|
+
<div
|
|
61
|
+
:style="{
|
|
62
|
+
width: 100,
|
|
63
|
+
height: 60,
|
|
64
|
+
backgroundImage: ArraySet1[1].url,
|
|
65
|
+
top: 500,
|
|
66
|
+
left: 800,
|
|
67
|
+
}"
|
|
68
|
+
></div>
|
|
69
|
+
<div
|
|
70
|
+
:style="{
|
|
71
|
+
width: 100,
|
|
72
|
+
height: 60,
|
|
73
|
+
backgroundImage: ArraySet1[2].url,
|
|
74
|
+
top: 500,
|
|
75
|
+
left: 920,
|
|
76
|
+
}"
|
|
77
|
+
></div>
|
|
78
|
+
<div
|
|
79
|
+
:style="{
|
|
80
|
+
width: 100,
|
|
81
|
+
height: 60,
|
|
82
|
+
backgroundImage: ArraySet1[3].url,
|
|
83
|
+
top: 550,
|
|
84
|
+
left: 700,
|
|
85
|
+
}"
|
|
86
|
+
></div>
|
|
87
|
+
<div
|
|
88
|
+
:style="{
|
|
89
|
+
width: 100,
|
|
90
|
+
height: 60,
|
|
91
|
+
backgroundImage: ArraySet1[4].url,
|
|
92
|
+
top: 550,
|
|
93
|
+
left: 820,
|
|
94
|
+
}"
|
|
95
|
+
></div>
|
|
96
|
+
<div
|
|
97
|
+
:style="{
|
|
98
|
+
width: 100,
|
|
99
|
+
height: 60,
|
|
100
|
+
backgroundImage: ArraySet1[5].url,
|
|
101
|
+
top: 550,
|
|
102
|
+
left: 920,
|
|
103
|
+
}"
|
|
104
|
+
></div>
|
|
105
|
+
<div
|
|
106
|
+
:style="{
|
|
107
|
+
width: 100,
|
|
108
|
+
height: 60,
|
|
109
|
+
backgroundImage: ArraySet1[6].url,
|
|
110
|
+
top: 600,
|
|
111
|
+
left: 700,
|
|
112
|
+
}"
|
|
113
|
+
></div>
|
|
114
|
+
<div
|
|
115
|
+
:style="{
|
|
116
|
+
width: 100,
|
|
117
|
+
height: 60,
|
|
118
|
+
backgroundImage: ArraySet1[7].url,
|
|
119
|
+
top: 600,
|
|
120
|
+
left: 770,
|
|
121
|
+
}"
|
|
122
|
+
></div>
|
|
123
|
+
<div
|
|
124
|
+
:style="{
|
|
125
|
+
width: 80,
|
|
126
|
+
height: 60,
|
|
127
|
+
backgroundImage: ArraySet1[8].url,
|
|
128
|
+
top: 600,
|
|
129
|
+
left: 860,
|
|
130
|
+
}"
|
|
131
|
+
></div>
|
|
132
|
+
<div
|
|
133
|
+
:style="{
|
|
134
|
+
width: 60,
|
|
135
|
+
height: 60,
|
|
136
|
+
backgroundImage: ArraySet1[9].url,
|
|
137
|
+
top: 600,
|
|
138
|
+
left: 930,
|
|
139
|
+
}"
|
|
140
|
+
></div>
|
|
141
|
+
<div
|
|
142
|
+
:style="{
|
|
143
|
+
width: 30,
|
|
144
|
+
height: 30,
|
|
145
|
+
backgroundImage: ArraySet1[10].url,
|
|
146
|
+
top: 590,
|
|
147
|
+
left: 950,
|
|
148
|
+
}"
|
|
149
|
+
></div>
|
|
150
|
+
<div
|
|
151
|
+
:style="{
|
|
152
|
+
width: 40,
|
|
153
|
+
height: 60,
|
|
154
|
+
backgroundImage: ArraySet1[11].url,
|
|
155
|
+
top: 600,
|
|
156
|
+
left: 980,
|
|
157
|
+
}"
|
|
158
|
+
></div>
|
|
15
159
|
</div>
|
|
16
160
|
</jsv-focus-block>
|
|
17
161
|
</template>
|
|
18
162
|
|
|
19
163
|
<script setup>
|
|
20
|
-
import { shallowRef } from "vue";
|
|
21
|
-
import { JsvPreload, buildPreloadInfo
|
|
22
|
-
import
|
|
23
|
-
import
|
|
24
|
-
|
|
25
|
-
import
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
buildPreloadInfo(
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
buildPreloadInfo(
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
164
|
+
import { shallowRef, onBeforeUnmount } from "vue";
|
|
165
|
+
import { JsvPreload, buildPreloadInfo } from "jsview";
|
|
166
|
+
import JsvSceneTransition from "./jsvSceneTransition.vue";
|
|
167
|
+
import { ArraySet1 } from "./maskConfig/config1";
|
|
168
|
+
import { ArraySet2 } from "./maskConfig/config2";
|
|
169
|
+
import { ArraySet3 } from "./maskConfig/config3";
|
|
170
|
+
|
|
171
|
+
const fly1 =
|
|
172
|
+
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/fly1.jpg";
|
|
173
|
+
const fly2 =
|
|
174
|
+
"https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/fly2.jpg";
|
|
175
|
+
//预加载数组
|
|
176
|
+
const preload_info = [buildPreloadInfo(fly1), buildPreloadInfo(fly2)];
|
|
177
|
+
|
|
178
|
+
//三个配置数组分别添加自己的图片地址进行预加载
|
|
179
|
+
ArraySet1.forEach((item, index) => {
|
|
180
|
+
preload_info.push(buildPreloadInfo(item.url));
|
|
181
|
+
});
|
|
182
|
+
ArraySet2.forEach((item, index) => {
|
|
183
|
+
preload_info.push(buildPreloadInfo(item.url));
|
|
184
|
+
});
|
|
185
|
+
ArraySet3.forEach((item, index) => {
|
|
186
|
+
preload_info.push(buildPreloadInfo(item.url));
|
|
187
|
+
});
|
|
188
|
+
|
|
189
|
+
//预加载完成标志
|
|
190
|
+
let isDone = shallowRef(false);
|
|
191
|
+
//小框显示标志
|
|
192
|
+
let boxSwitch = shallowRef(false);
|
|
193
|
+
//计时器
|
|
194
|
+
let timer = { id: -1 };
|
|
195
|
+
//预加载完成回调
|
|
196
|
+
const loadDone = () => {
|
|
197
|
+
isDone.value = true;
|
|
198
|
+
};
|
|
54
199
|
const style = { width: 1280, height: 720 };
|
|
55
200
|
let isShow = shallowRef(false);
|
|
56
201
|
let bg = shallowRef(fly1);
|
|
57
202
|
let onOff = shallowRef(false);
|
|
58
203
|
|
|
59
|
-
|
|
60
|
-
const
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
{
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
url: png1,
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
left: 301,
|
|
75
|
-
top: 0,
|
|
76
|
-
width: 590,
|
|
77
|
-
height: 266,
|
|
78
|
-
url: png2,
|
|
79
|
-
},
|
|
80
|
-
{
|
|
81
|
-
left: 693,
|
|
82
|
-
top: 0,
|
|
83
|
-
width: 587,
|
|
84
|
-
height: 306,
|
|
85
|
-
url: png3,
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
left: 0,
|
|
89
|
-
top: 140,
|
|
90
|
-
width: 561,
|
|
91
|
-
height: 431,
|
|
92
|
-
url: png4,
|
|
93
|
-
},
|
|
94
|
-
{
|
|
95
|
-
left: 482,
|
|
96
|
-
top: 140,
|
|
97
|
-
width: 409,
|
|
98
|
-
height: 377,
|
|
99
|
-
url: png5,
|
|
100
|
-
},
|
|
101
|
-
{
|
|
102
|
-
left: 717,
|
|
103
|
-
top: 247,
|
|
104
|
-
width: 563,
|
|
105
|
-
height: 247,
|
|
106
|
-
url: png6,
|
|
107
|
-
},
|
|
108
|
-
{
|
|
109
|
-
left: 0,
|
|
110
|
-
top: 385,
|
|
111
|
-
width: 533,
|
|
112
|
-
height: 335,
|
|
113
|
-
url: png7,
|
|
114
|
-
},
|
|
115
|
-
{
|
|
116
|
-
left: 333,
|
|
117
|
-
top: 392,
|
|
118
|
-
width: 293,
|
|
119
|
-
height: 328,
|
|
120
|
-
url: png8,
|
|
121
|
-
},
|
|
122
|
-
{
|
|
123
|
-
left: 569,
|
|
124
|
-
top: 452,
|
|
125
|
-
width: 213,
|
|
126
|
-
height: 268,
|
|
127
|
-
url: png9,
|
|
128
|
-
},
|
|
129
|
-
{
|
|
130
|
-
left: 714,
|
|
131
|
-
top: 405,
|
|
132
|
-
width: 332,
|
|
133
|
-
height: 315,
|
|
134
|
-
url: png10,
|
|
135
|
-
},
|
|
136
|
-
{
|
|
137
|
-
left: 810,
|
|
138
|
-
top: 387,
|
|
139
|
-
width: 172,
|
|
140
|
-
height: 117,
|
|
141
|
-
url: png11,
|
|
142
|
-
},
|
|
143
|
-
{
|
|
144
|
-
left: 893,
|
|
145
|
-
top: 428,
|
|
146
|
-
width: 387,
|
|
147
|
-
height: 292,
|
|
148
|
-
url: png12,
|
|
149
|
-
},
|
|
150
|
-
];
|
|
204
|
+
//随机选择数组
|
|
205
|
+
const randomSelect = () => {
|
|
206
|
+
let randomNum = Math.random();
|
|
207
|
+
if (randomNum <= 0.33) {
|
|
208
|
+
return ArraySet1;
|
|
209
|
+
} else if (randomNum <= 0.66) {
|
|
210
|
+
return ArraySet2;
|
|
211
|
+
} else {
|
|
212
|
+
return ArraySet3;
|
|
213
|
+
}
|
|
214
|
+
};
|
|
215
|
+
const SelectArray = randomSelect();
|
|
151
216
|
|
|
152
217
|
const onKeyDown = (ev) => {
|
|
153
218
|
switch (ev.keyCode) {
|
|
154
219
|
case 13:
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
220
|
+
if (isDone.value == true) {
|
|
221
|
+
bg.value = fly2;
|
|
222
|
+
onOff.value = true;
|
|
223
|
+
isShow.value = true;
|
|
224
|
+
} else {
|
|
225
|
+
boxSwitch.value = true;
|
|
226
|
+
timer.id = setTimeout(() => {
|
|
227
|
+
boxSwitch.value = false;
|
|
228
|
+
}, 1000);
|
|
229
|
+
}
|
|
230
|
+
|
|
158
231
|
break;
|
|
159
232
|
|
|
160
233
|
default:
|
|
161
234
|
break;
|
|
162
235
|
}
|
|
163
236
|
};
|
|
237
|
+
//卸载时清除定时器
|
|
238
|
+
onBeforeUnmount(() => {
|
|
239
|
+
if (timer.id) {
|
|
240
|
+
clearTimeout(timer.id);
|
|
241
|
+
timer.id = -1;
|
|
242
|
+
}
|
|
243
|
+
});
|
|
164
244
|
</script>
|
|
165
245
|
|
|
166
246
|
<style scoped>
|
|
167
|
-
.text{
|
|
168
|
-
width:300;
|
|
169
|
-
height:
|
|
170
|
-
color
|
|
247
|
+
.text {
|
|
248
|
+
width: 300;
|
|
249
|
+
height: 80;
|
|
250
|
+
color: #ffffff;
|
|
171
251
|
font-weight: bold;
|
|
172
252
|
line-height: 26;
|
|
173
253
|
font-size: 24;
|
|
174
|
-
|
|
175
|
-
|
|
254
|
+
}
|
|
255
|
+
.bgStyle {
|
|
256
|
+
width: 1280;
|
|
257
|
+
height: 720;
|
|
258
|
+
background-color: #007788;
|
|
259
|
+
}
|
|
260
|
+
.smallBox {
|
|
261
|
+
width: 300;
|
|
262
|
+
height: 100;
|
|
263
|
+
left: 170;
|
|
264
|
+
top: 230;
|
|
265
|
+
border-radius: 20;
|
|
266
|
+
background-color: #006400;
|
|
176
267
|
}
|
|
177
268
|
</style>
|
|
@@ -5,17 +5,17 @@
|
|
|
5
5
|
* imageUrl {String} (必填) 显示图片的加载地址
|
|
6
6
|
* displayWidth {Number} (必填) 想要展示的宽度
|
|
7
7
|
* ArraySet {Array} (必填) 模板配置项,包括:每个模块的width,height,left,top,url
|
|
8
|
-
* style {Object} (必填)
|
|
8
|
+
* style {Object} (必填) 模板配置总长度和总宽度。(width,height)
|
|
9
9
|
* onOff {Boolean} (必填) 组件挂载好后是否立即动画的开关,后续可通过改值为true开启。
|
|
10
10
|
-->
|
|
11
11
|
|
|
12
12
|
<template>
|
|
13
13
|
<div
|
|
14
14
|
:style="{
|
|
15
|
-
width:
|
|
16
|
-
height:
|
|
17
|
-
transform: `scale3d(${props.displayWidth /
|
|
18
|
-
props.displayWidth /
|
|
15
|
+
width: props.style.width,
|
|
16
|
+
height: props.style.height,
|
|
17
|
+
transform: `scale3d(${props.displayWidth / props.style.width},${
|
|
18
|
+
props.displayWidth / props.style.width
|
|
19
19
|
},1)`,
|
|
20
20
|
transformOrigin: 'left top',
|
|
21
21
|
}"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
|
|
49
49
|
<script setup>
|
|
50
50
|
import { JsvMaskClipDiv, JsvFreeMoveActor } from "jsview";
|
|
51
|
-
import { onMounted,
|
|
51
|
+
import { onMounted, watch } from "vue";
|
|
52
52
|
|
|
53
53
|
const props = defineProps({
|
|
54
54
|
imageUrl: { type: String, require: true },
|
|
@@ -57,12 +57,27 @@ const props = defineProps({
|
|
|
57
57
|
style: { type: Object, require: true },
|
|
58
58
|
onOff: { type: Boolean, require: true },
|
|
59
59
|
});
|
|
60
|
-
|
|
61
|
-
//12个FreeMove引用
|
|
60
|
+
//FreeMove引用
|
|
62
61
|
const refArray = [];
|
|
63
62
|
const controlArray = new Array(props.ArraySet.length).fill(null);
|
|
64
|
-
const timer = { id: -1 };
|
|
65
63
|
|
|
64
|
+
//算图的中心点
|
|
65
|
+
const center = {
|
|
66
|
+
x: Math.floor(props.style.width / 2),
|
|
67
|
+
y: Math.floor(props.style.height / 2),
|
|
68
|
+
};
|
|
69
|
+
//算所有遮罩层中心点
|
|
70
|
+
const centerItemArray = [];
|
|
71
|
+
props.ArraySet.forEach((item, index) => {
|
|
72
|
+
const centerX = (item.left + item.width) / 2;
|
|
73
|
+
const centerY = (item.top + item.height) / 2;
|
|
74
|
+
centerItemArray.push({
|
|
75
|
+
x: centerX,
|
|
76
|
+
y: centerY,
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
|
|
80
|
+
//监听控制开关的值
|
|
66
81
|
watch(
|
|
67
82
|
() => props.onOff,
|
|
68
83
|
(n, o) => {
|
|
@@ -71,109 +86,80 @@ watch(
|
|
|
71
86
|
}
|
|
72
87
|
}
|
|
73
88
|
);
|
|
74
|
-
|
|
89
|
+
//Y轴方向随机初速度
|
|
90
|
+
const randomYArray = [-60, -70, -80];
|
|
91
|
+
const randomSelect = () => {
|
|
92
|
+
let randomNum = Math.random();
|
|
93
|
+
if (randomNum < 0.33) {
|
|
94
|
+
return randomYArray[0];
|
|
95
|
+
} else if (randomNum < 0.66) {
|
|
96
|
+
return randomYArray[1];
|
|
97
|
+
} else {
|
|
98
|
+
return randomYArray[2];
|
|
99
|
+
}
|
|
100
|
+
};
|
|
75
101
|
//运动函数
|
|
76
102
|
const MoveFunc = () => {
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
.
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
.condition()
|
|
131
|
-
.reachPosition(undefined, 720)
|
|
132
|
-
.then([controlArray[7].action().stopMoving()]),
|
|
133
|
-
]);
|
|
134
|
-
controlArray[8].run([
|
|
135
|
-
controlArray[8].action().setSpdAndAccel(2, -7, 0, 1, null, null),
|
|
136
|
-
controlArray[8]
|
|
137
|
-
.condition()
|
|
138
|
-
.reachPosition(undefined, 720)
|
|
139
|
-
.then([controlArray[8].action().stopMoving()]),
|
|
140
|
-
]);
|
|
141
|
-
controlArray[9].run([
|
|
142
|
-
controlArray[9].action().setSpdAndAccel(6, -7, 0, 1, null, null),
|
|
143
|
-
controlArray[9]
|
|
144
|
-
.condition()
|
|
145
|
-
.reachPosition(undefined, 720)
|
|
146
|
-
.then([controlArray[9].action().stopMoving()]),
|
|
147
|
-
]);
|
|
148
|
-
controlArray[10].run([
|
|
149
|
-
controlArray[10].action().setSpdAndAccel(4, -4, 0, 1, null, null),
|
|
150
|
-
controlArray[10]
|
|
151
|
-
.condition()
|
|
152
|
-
.reachPosition(undefined, 720)
|
|
153
|
-
.then([controlArray[10].action().stopMoving()]),
|
|
154
|
-
]);
|
|
155
|
-
controlArray[11].run([
|
|
156
|
-
controlArray[11].action().setSpdAndAccel(6, -4, 0, 1, null, null),
|
|
157
|
-
controlArray[11]
|
|
158
|
-
.condition()
|
|
159
|
-
.reachPosition(undefined, 720)
|
|
160
|
-
.then([controlArray[11].action().stopMoving()]),
|
|
161
|
-
]);
|
|
103
|
+
centerItemArray.forEach((item, index) => {
|
|
104
|
+
if (center.x - item.x <= Math.abs(60)) {
|
|
105
|
+
controlArray[index].run([
|
|
106
|
+
controlArray[index]
|
|
107
|
+
.action()
|
|
108
|
+
.setSpdAndAccel(16, randomSelect(), 0, 15, null, null),
|
|
109
|
+
controlArray[index]
|
|
110
|
+
.condition()
|
|
111
|
+
.reachPosition(undefined, 1380)
|
|
112
|
+
.then([controlArray[index].action().stopMoving()]),
|
|
113
|
+
]);
|
|
114
|
+
} else if (center.x - item.x <= 200) {
|
|
115
|
+
controlArray[index].run([
|
|
116
|
+
controlArray[index]
|
|
117
|
+
.action()
|
|
118
|
+
.setSpdAndAccel(8, randomSelect(), 0, 15, null, null),
|
|
119
|
+
controlArray[index]
|
|
120
|
+
.condition()
|
|
121
|
+
.reachPosition(undefined, 1380)
|
|
122
|
+
.then([controlArray[index].action().stopMoving()]),
|
|
123
|
+
]);
|
|
124
|
+
} else if (center.x - item.x <= 500) {
|
|
125
|
+
controlArray[index].run([
|
|
126
|
+
controlArray[index]
|
|
127
|
+
.action()
|
|
128
|
+
.setSpdAndAccel(-8, randomSelect(), 0, 15, null, null),
|
|
129
|
+
controlArray[index]
|
|
130
|
+
.condition()
|
|
131
|
+
.reachPosition(undefined, 1380)
|
|
132
|
+
.then([controlArray[index].action().stopMoving()]),
|
|
133
|
+
]);
|
|
134
|
+
} else if (center.x - item.x > 500) {
|
|
135
|
+
controlArray[index].run([
|
|
136
|
+
controlArray[index]
|
|
137
|
+
.action()
|
|
138
|
+
.setSpdAndAccel(-16, randomSelect(), 0, 15, null, null),
|
|
139
|
+
controlArray[index]
|
|
140
|
+
.condition()
|
|
141
|
+
.reachPosition(undefined, 1380)
|
|
142
|
+
.then([controlArray[index].action().stopMoving()]),
|
|
143
|
+
]);
|
|
144
|
+
} else if (center.x - item.x < -60) {
|
|
145
|
+
controlArray[index].run([
|
|
146
|
+
controlArray[index]
|
|
147
|
+
.action()
|
|
148
|
+
.setSpdAndAccel(20, randomSelect(), 0, 15, null, null),
|
|
149
|
+
controlArray[index]
|
|
150
|
+
.condition()
|
|
151
|
+
.reachPosition(undefined, 1380)
|
|
152
|
+
.then([controlArray[index].action().stopMoving()]),
|
|
153
|
+
]);
|
|
154
|
+
}
|
|
155
|
+
});
|
|
162
156
|
};
|
|
163
157
|
onMounted(() => {
|
|
164
158
|
for (let i = 0; i < refArray.length; i++) {
|
|
165
159
|
controlArray[i] = refArray[i].control;
|
|
166
160
|
}
|
|
167
161
|
if (props.onOff == true) {
|
|
168
|
-
|
|
169
|
-
MoveFunc();
|
|
170
|
-
// }, 1000);
|
|
171
|
-
}
|
|
172
|
-
});
|
|
173
|
-
onBeforeUnmount(() => {
|
|
174
|
-
if (timer.id !== -1) {
|
|
175
|
-
clearTimeout(timer.id);
|
|
176
|
-
timer.id = -1;
|
|
162
|
+
MoveFunc();
|
|
177
163
|
}
|
|
178
164
|
});
|
|
179
165
|
</script>
|
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
// 遮罩拼图格式1的配置
|
|
2
|
+
import mask1_1 from "../images/mask/1.png";
|
|
3
|
+
import mask1_2 from "../images/mask/2.png";
|
|
4
|
+
import mask1_3 from "../images/mask/3.png";
|
|
5
|
+
import mask1_4 from "../images/mask/4.png";
|
|
6
|
+
import mask1_5 from "../images/mask/5.png";
|
|
7
|
+
import mask1_6 from "../images/mask/6.png";
|
|
8
|
+
import mask1_7 from "../images/mask/7.png";
|
|
9
|
+
import mask1_8 from "../images/mask/8.png";
|
|
10
|
+
import mask1_9 from "../images/mask/9.png";
|
|
11
|
+
import mask1_10 from "../images/mask/10.png";
|
|
12
|
+
import mask1_11 from "../images/mask/11.png";
|
|
13
|
+
import mask1_12 from "../images/mask/12.png";
|
|
14
|
+
|
|
15
|
+
const ArraySet1 = [
|
|
16
|
+
{
|
|
17
|
+
left: 0,
|
|
18
|
+
top: 0,
|
|
19
|
+
width: 521,
|
|
20
|
+
height: 302,
|
|
21
|
+
url: mask1_1,
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
left: 301,
|
|
25
|
+
top: 0,
|
|
26
|
+
width: 590,
|
|
27
|
+
height: 266,
|
|
28
|
+
url: mask1_2,
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
left: 693,
|
|
32
|
+
top: 0,
|
|
33
|
+
width: 587,
|
|
34
|
+
height: 306,
|
|
35
|
+
url: mask1_3,
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
left: 0,
|
|
39
|
+
top: 140,
|
|
40
|
+
width: 561,
|
|
41
|
+
height: 431,
|
|
42
|
+
url: mask1_4,
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
left: 482,
|
|
46
|
+
top: 140,
|
|
47
|
+
width: 409,
|
|
48
|
+
height: 377,
|
|
49
|
+
url: mask1_5,
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
left: 717,
|
|
53
|
+
top: 247,
|
|
54
|
+
width: 563,
|
|
55
|
+
height: 247,
|
|
56
|
+
url: mask1_6,
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
left: 0,
|
|
60
|
+
top: 385,
|
|
61
|
+
width: 533,
|
|
62
|
+
height: 335,
|
|
63
|
+
url: mask1_7,
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
left: 333,
|
|
67
|
+
top: 392,
|
|
68
|
+
width: 293,
|
|
69
|
+
height: 328,
|
|
70
|
+
url: mask1_8,
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
left: 569,
|
|
74
|
+
top: 452,
|
|
75
|
+
width: 213,
|
|
76
|
+
height: 268,
|
|
77
|
+
url: mask1_9,
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
left: 714,
|
|
81
|
+
top: 405,
|
|
82
|
+
width: 332,
|
|
83
|
+
height: 315,
|
|
84
|
+
url: mask1_10,
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
left: 810,
|
|
88
|
+
top: 387,
|
|
89
|
+
width: 172,
|
|
90
|
+
height: 117,
|
|
91
|
+
url: mask1_11,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
left: 893,
|
|
95
|
+
top: 428,
|
|
96
|
+
width: 387,
|
|
97
|
+
height: 292,
|
|
98
|
+
url: mask1_12,
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
export { ArraySet1 }
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
// 遮罩拼图格式2的配置
|
|
2
|
+
const ArraySet2 = [
|
|
3
|
+
{
|
|
4
|
+
left: 0,
|
|
5
|
+
top: 0,
|
|
6
|
+
width: 565,
|
|
7
|
+
height: 395,
|
|
8
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/1.png",
|
|
9
|
+
},
|
|
10
|
+
{
|
|
11
|
+
left: 245,
|
|
12
|
+
top: 0,
|
|
13
|
+
width: 377,
|
|
14
|
+
height: 305,
|
|
15
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/2.png",
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
left: 600,
|
|
19
|
+
top: 0,
|
|
20
|
+
width: 236,
|
|
21
|
+
height: 276,
|
|
22
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/3.png",
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
left: 719,
|
|
26
|
+
top: 0,
|
|
27
|
+
width: 418,
|
|
28
|
+
height: 306,
|
|
29
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/4.png",
|
|
30
|
+
},
|
|
31
|
+
{
|
|
32
|
+
left: 783,
|
|
33
|
+
top: 0,
|
|
34
|
+
width: 497,
|
|
35
|
+
height: 415,
|
|
36
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/5.png",
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
left: 0,
|
|
40
|
+
top: 366,
|
|
41
|
+
width: 531,
|
|
42
|
+
height: 301,
|
|
43
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/6.png",
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
left: 494,
|
|
47
|
+
top: 217,
|
|
48
|
+
width: 481,
|
|
49
|
+
height: 340,
|
|
50
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/7.png",
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
left: 891,
|
|
54
|
+
top: 332,
|
|
55
|
+
width: 389,
|
|
56
|
+
height: 388,
|
|
57
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/8.png",
|
|
58
|
+
},
|
|
59
|
+
{
|
|
60
|
+
left: 0,
|
|
61
|
+
top: 429,
|
|
62
|
+
width: 601,
|
|
63
|
+
height: 291,
|
|
64
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/9.png",
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
left: 364,
|
|
68
|
+
top: 510,
|
|
69
|
+
width: 254,
|
|
70
|
+
height: 210,
|
|
71
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/10.png",
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
left: 573,
|
|
75
|
+
top: 447,
|
|
76
|
+
width: 230,
|
|
77
|
+
height: 273,
|
|
78
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/11.png",
|
|
79
|
+
},
|
|
80
|
+
{
|
|
81
|
+
left: 708,
|
|
82
|
+
top: 453,
|
|
83
|
+
width: 474,
|
|
84
|
+
height: 267,
|
|
85
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask1/12.png",
|
|
86
|
+
},
|
|
87
|
+
];
|
|
88
|
+
export { ArraySet2}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
const ArraySet3 = [
|
|
2
|
+
{
|
|
3
|
+
left: 0,
|
|
4
|
+
top: 0,
|
|
5
|
+
width: 232,
|
|
6
|
+
height: 287,
|
|
7
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/1.png",
|
|
8
|
+
},
|
|
9
|
+
{
|
|
10
|
+
left: 213,
|
|
11
|
+
top: 0,
|
|
12
|
+
width: 588,
|
|
13
|
+
height: 315,
|
|
14
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/2.png",
|
|
15
|
+
},
|
|
16
|
+
{
|
|
17
|
+
left: 223,
|
|
18
|
+
top: 0,
|
|
19
|
+
width: 582,
|
|
20
|
+
height: 316,
|
|
21
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/3.png",
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
left: 811,
|
|
25
|
+
top: 62,
|
|
26
|
+
width: 469,
|
|
27
|
+
height: 257,
|
|
28
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/4.png",
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
left: 943,
|
|
32
|
+
top: 0,
|
|
33
|
+
width: 337,
|
|
34
|
+
height: 162,
|
|
35
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/5.png",
|
|
36
|
+
},
|
|
37
|
+
{
|
|
38
|
+
left: 0,
|
|
39
|
+
top: 260,
|
|
40
|
+
width: 272,
|
|
41
|
+
height: 460,
|
|
42
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/6.png",
|
|
43
|
+
},
|
|
44
|
+
{
|
|
45
|
+
left: 86,
|
|
46
|
+
top: 168,
|
|
47
|
+
width: 728,
|
|
48
|
+
height: 350,
|
|
49
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/7.png",
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
left: 806,
|
|
53
|
+
top: 223,
|
|
54
|
+
width: 474,
|
|
55
|
+
height: 133,
|
|
56
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/8.png",
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
left: 706,
|
|
60
|
+
top: 0,
|
|
61
|
+
width: 295,
|
|
62
|
+
height: 319,
|
|
63
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/9.png",
|
|
64
|
+
},
|
|
65
|
+
{
|
|
66
|
+
left: 51,
|
|
67
|
+
top: 319,
|
|
68
|
+
width: 765,
|
|
69
|
+
height: 401,
|
|
70
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/10.png",
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
left: 688,
|
|
74
|
+
top: 321,
|
|
75
|
+
width: 304,
|
|
76
|
+
height: 399,
|
|
77
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/11.png",
|
|
78
|
+
},
|
|
79
|
+
{
|
|
80
|
+
left: 814,
|
|
81
|
+
top: 320,
|
|
82
|
+
width: 345,
|
|
83
|
+
height: 400,
|
|
84
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/12.png",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
left: 816,
|
|
88
|
+
top: 315,
|
|
89
|
+
width: 464,
|
|
90
|
+
height: 211,
|
|
91
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/13.png",
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
left: 979,
|
|
95
|
+
top: 413,
|
|
96
|
+
width: 301,
|
|
97
|
+
height: 307,
|
|
98
|
+
url: "https://qcast-image.oss-cn-qingdao.aliyuncs.com/JsViewVideo/ImageTestSample/SceneTransition/mask2/14.png",
|
|
99
|
+
},
|
|
100
|
+
];
|
|
101
|
+
|
|
102
|
+
export { ArraySet3 }
|
package/TextureStoreTest/App.vue
CHANGED
|
@@ -7,12 +7,16 @@
|
|
|
7
7
|
left: 200,
|
|
8
8
|
}"
|
|
9
9
|
>
|
|
10
|
-
<img
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
<img
|
|
11
|
+
:src="`jsvtexturestore://${sourceId}`"
|
|
12
|
+
class="logo-size"
|
|
13
|
+
:style="{
|
|
14
|
+
left: 50,
|
|
15
|
+
top: 50,
|
|
16
|
+
}"
|
|
17
|
+
/>
|
|
14
18
|
</div>
|
|
15
|
-
<!--
|
|
19
|
+
<!-- 圆框点九-底色 -->
|
|
16
20
|
<div
|
|
17
21
|
class="logo-bg"
|
|
18
22
|
:style="{
|
|
@@ -28,24 +32,24 @@
|
|
|
28
32
|
backgroundColor: '#FF1213',
|
|
29
33
|
top: 50,
|
|
30
34
|
}"
|
|
31
|
-
>
|
|
32
|
-
<JsvNinePatch
|
|
33
|
-
:style="{
|
|
34
|
-
left: 0,
|
|
35
|
-
top: 0,
|
|
36
|
-
width: 200,
|
|
37
|
-
height: 200,
|
|
38
|
-
}"
|
|
39
|
-
:imageUrl="`jsvtexturestore://${sourceId2}`"
|
|
40
|
-
:imageWidth="136"
|
|
41
|
-
:centerWidth="1"
|
|
42
|
-
:imageDspWidth="136"
|
|
43
|
-
:borderOutset="8"
|
|
44
|
-
:animTime="0"
|
|
45
|
-
/>
|
|
46
|
-
</div>
|
|
35
|
+
></div>
|
|
47
36
|
</div>
|
|
48
|
-
<!--
|
|
37
|
+
<!-- 圆框点九-框 -->
|
|
38
|
+
<JsvNinePatch
|
|
39
|
+
:style="{
|
|
40
|
+
left: 750,
|
|
41
|
+
top: 50,
|
|
42
|
+
width: 200,
|
|
43
|
+
height: 200,
|
|
44
|
+
}"
|
|
45
|
+
:imageUrl="`jsvtexturestore://${sourceId2}`"
|
|
46
|
+
:imageWidth="136"
|
|
47
|
+
:centerWidth="1"
|
|
48
|
+
:imageDspWidth="136"
|
|
49
|
+
:borderOutset="8"
|
|
50
|
+
:animTime="0"
|
|
51
|
+
/>
|
|
52
|
+
<!-- 方框点九-底色 -->
|
|
49
53
|
<div class="logo-bg" :style="{ left: 200, top: 360 }">
|
|
50
54
|
<div
|
|
51
55
|
class="logo-size"
|
|
@@ -54,27 +58,67 @@
|
|
|
54
58
|
backgroundColor: '#FF1213',
|
|
55
59
|
top: 50,
|
|
56
60
|
}"
|
|
57
|
-
>
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
61
|
+
></div>
|
|
62
|
+
</div>
|
|
63
|
+
<!-- 方框点九-框 -->
|
|
64
|
+
<JsvNinePatch
|
|
65
|
+
:style="{
|
|
66
|
+
left: 250,
|
|
67
|
+
top: 410,
|
|
68
|
+
width: 200,
|
|
69
|
+
height: 200,
|
|
70
|
+
}"
|
|
71
|
+
:imageUrl="`jsvtexturestore://${sourceId3}`"
|
|
72
|
+
:imageWidth="136"
|
|
73
|
+
:centerWidth="1"
|
|
74
|
+
:imageDspWidth="136"
|
|
75
|
+
:borderOutset="6"
|
|
76
|
+
:animTime="0"
|
|
77
|
+
/>
|
|
78
|
+
<!-- 渐变点九-底色 -->
|
|
79
|
+
<div
|
|
80
|
+
class="logo-bg"
|
|
81
|
+
:style="{
|
|
82
|
+
left: 700,
|
|
83
|
+
top: 360,
|
|
84
|
+
}"
|
|
85
|
+
>
|
|
86
|
+
<div
|
|
87
|
+
class="logo-size"
|
|
88
|
+
:style="{
|
|
89
|
+
borderRadius: 60,
|
|
90
|
+
left: 50,
|
|
91
|
+
backgroundImage: `jsvtexturestore://${sourceId4}`,
|
|
92
|
+
top: 50,
|
|
93
|
+
}"
|
|
94
|
+
></div>
|
|
73
95
|
</div>
|
|
96
|
+
<!-- 渐变点九-框(同圆框点九框) -->
|
|
97
|
+
<JsvNinePatch
|
|
98
|
+
:style="{
|
|
99
|
+
left: 750,
|
|
100
|
+
top: 410,
|
|
101
|
+
width: 200,
|
|
102
|
+
height: 200,
|
|
103
|
+
}"
|
|
104
|
+
:imageUrl="`jsvtexturestore://${sourceId2}`"
|
|
105
|
+
:imageWidth="136"
|
|
106
|
+
:centerWidth="1"
|
|
107
|
+
:imageDspWidth="136"
|
|
108
|
+
:borderOutset="8"
|
|
109
|
+
:animTime="0"
|
|
110
|
+
/>
|
|
74
111
|
<!-- 文字说明 -->
|
|
75
|
-
<div class="text" :style="{top:320,left:200}">{{
|
|
76
|
-
<div class="text" :style="{top:320,left:700}">
|
|
77
|
-
|
|
112
|
+
<div class="text" :style="{ top: 320, left: 200 }">{{ "半圆" }}</div>
|
|
113
|
+
<div class="text" :style="{ top: 320, left: 700 }">
|
|
114
|
+
{{ "圆角NinePatch" }}
|
|
115
|
+
</div>
|
|
116
|
+
<div class="text" :style="{ top: 680, left: 200 }">
|
|
117
|
+
{{ "直角NinePatch" }}
|
|
118
|
+
</div>
|
|
119
|
+
<div class="text" :style="{ top: 680, left: 700 }">
|
|
120
|
+
{{ "渐变圆角NinePatch" }}
|
|
121
|
+
</div>
|
|
78
122
|
</div>
|
|
79
123
|
</template>
|
|
80
124
|
|
|
@@ -85,9 +129,11 @@ import { JsvTextureStoreApi } from "jsview";
|
|
|
85
129
|
let canvasRef;
|
|
86
130
|
let canvasRef2;
|
|
87
131
|
let canvasRef3;
|
|
132
|
+
let canvasRef4;
|
|
88
133
|
let sourceId = shallowRef("");
|
|
89
134
|
let sourceId2 = shallowRef("");
|
|
90
135
|
let sourceId3 = shallowRef("");
|
|
136
|
+
let sourceId4 = shallowRef("");
|
|
91
137
|
let bitmap = {
|
|
92
138
|
width: 150,
|
|
93
139
|
height: 150,
|
|
@@ -100,9 +146,14 @@ let bitmap3 = {
|
|
|
100
146
|
width: 136,
|
|
101
147
|
height: 136,
|
|
102
148
|
};
|
|
149
|
+
let bitmap4 = {
|
|
150
|
+
width: 136,
|
|
151
|
+
height: 136,
|
|
152
|
+
};
|
|
103
153
|
canvasRef = JsvTextureStoreApi.canvasTexture(bitmap.width, bitmap.height);
|
|
104
154
|
canvasRef2 = JsvTextureStoreApi.canvasTexture(bitmap2.width, bitmap2.height);
|
|
105
155
|
canvasRef3 = JsvTextureStoreApi.canvasTexture(bitmap3.width, bitmap3.height);
|
|
156
|
+
canvasRef4 = JsvTextureStoreApi.canvasTexture(bitmap4.width, bitmap4.height);
|
|
106
157
|
//第一个图
|
|
107
158
|
let centerX = bitmap.width / 2;
|
|
108
159
|
let centerY = bitmap.height / 2;
|
|
@@ -134,11 +185,26 @@ sourceId2.value = canvasRef2.commit();
|
|
|
134
185
|
let customPath3 = canvasRef3.rectPath(3, 3, 133, 133);
|
|
135
186
|
customPath3.stroke(6, "#87CEEB");
|
|
136
187
|
sourceId3.value = canvasRef3.commit();
|
|
188
|
+
//第四个图(底色即使用渐变色接口描绘)
|
|
189
|
+
const multiColorSet = {
|
|
190
|
+
color: ["#ff0000", "#0000ff", "#00ff00", "#ff00ff"],
|
|
191
|
+
position: [0, 0.3, 0.8, 1],
|
|
192
|
+
};
|
|
193
|
+
canvasRef4.drawLinearGradientRect(
|
|
194
|
+
0,
|
|
195
|
+
0,
|
|
196
|
+
0,
|
|
197
|
+
136,
|
|
198
|
+
multiColorSet.color,
|
|
199
|
+
multiColorSet.position
|
|
200
|
+
);
|
|
201
|
+
sourceId4.value = canvasRef4.commit();
|
|
137
202
|
|
|
138
203
|
onBeforeUnmount(() => {
|
|
139
204
|
JsvTextureStoreApi.deleteTexture(sourceId.value);
|
|
140
205
|
JsvTextureStoreApi.deleteTexture(sourceId2.value);
|
|
141
206
|
JsvTextureStoreApi.deleteTexture(sourceId3.value);
|
|
207
|
+
JsvTextureStoreApi.deleteTexture(sourceId4.value);
|
|
142
208
|
});
|
|
143
209
|
</script>
|
|
144
210
|
|
|
@@ -157,12 +223,12 @@ onBeforeUnmount(() => {
|
|
|
157
223
|
height: 300;
|
|
158
224
|
background-color: #007f00;
|
|
159
225
|
}
|
|
160
|
-
.text{
|
|
161
|
-
width:300;
|
|
162
|
-
height:30;
|
|
226
|
+
.text {
|
|
227
|
+
width: 300;
|
|
228
|
+
height: 30;
|
|
163
229
|
font-size: 28;
|
|
164
230
|
line-height: 30;
|
|
165
|
-
color: #
|
|
231
|
+
color: #ffffff;
|
|
166
232
|
text-align: center;
|
|
167
233
|
}
|
|
168
234
|
</style>
|
package/package.json
CHANGED
|
Binary file
|
|
Binary file
|
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"style": "Irregular",
|
|
3
|
-
"type":"Regular",
|
|
4
|
-
"age": [3, 4],
|
|
5
|
-
"level": 1,
|
|
6
|
-
"grade": "Easy",
|
|
7
|
-
"components": [
|
|
8
|
-
{
|
|
9
|
-
"key": "1",
|
|
10
|
-
"x": 0,
|
|
11
|
-
"y": 0
|
|
12
|
-
},
|
|
13
|
-
{
|
|
14
|
-
"key": "2",
|
|
15
|
-
"x": 227,
|
|
16
|
-
"y": 0
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
"key": "3",
|
|
20
|
-
"x": 0,
|
|
21
|
-
"y": 327
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"key": "4",
|
|
25
|
-
"x": 327,
|
|
26
|
-
"y": 227
|
|
27
|
-
}
|
|
28
|
-
]
|
|
29
|
-
}
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|
|
Binary file
|