@shijiu/jsview-vue-samples 2.1.428 → 2.1.448-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.
@@ -7,12 +7,16 @@
7
7
  left: 200,
8
8
  }"
9
9
  >
10
- <img :src="`jsvtexturestore://${sourceId}`" class="logo-size" :style="{
11
- left:50,
12
- top:50
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,40 +58,81 @@
54
58
  backgroundColor: '#FF1213',
55
59
  top: 50,
56
60
  }"
57
- >
58
- <JsvNinePatch
59
- :style="{
60
- left: 0,
61
- top: 0,
62
- width: 200,
63
- height: 200,
64
- }"
65
- :imageUrl="`jsvtexturestore://${sourceId3}`"
66
- :imageWidth="136"
67
- :centerWidth="1"
68
- :imageDspWidth="136"
69
- :borderOutset="6"
70
- :animTime="0"
71
- />
72
- </div>
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}">{{ '半圆' }}</div>
76
- <div class="text" :style="{top:320,left:700}">{{ '圆角NinePatch' }}</div>
77
- <div class="text" :style="{top:680,left:200}">{{ '直角NinePatch' }}</div>
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
 
81
125
  <script setup>
82
- import JsvNinePatch from "@shijiu/jsview-vue/utils/JsViewVueWidget/JsvNinePatch.vue";
83
126
  import { shallowRef, onBeforeUnmount } from "vue";
84
- import { JsvTextureStoreApi } from "jsview";
127
+ import { JsvTextureStoreApi, JsvNinePatch } from "jsview";
85
128
  let canvasRef;
86
129
  let canvasRef2;
87
130
  let canvasRef3;
131
+ let canvasRef4;
88
132
  let sourceId = shallowRef("");
89
133
  let sourceId2 = shallowRef("");
90
134
  let sourceId3 = shallowRef("");
135
+ let sourceId4 = shallowRef("");
91
136
  let bitmap = {
92
137
  width: 150,
93
138
  height: 150,
@@ -100,9 +145,14 @@ let bitmap3 = {
100
145
  width: 136,
101
146
  height: 136,
102
147
  };
148
+ let bitmap4 = {
149
+ width: 136,
150
+ height: 136,
151
+ };
103
152
  canvasRef = JsvTextureStoreApi.canvasTexture(bitmap.width, bitmap.height);
104
153
  canvasRef2 = JsvTextureStoreApi.canvasTexture(bitmap2.width, bitmap2.height);
105
154
  canvasRef3 = JsvTextureStoreApi.canvasTexture(bitmap3.width, bitmap3.height);
155
+ canvasRef4 = JsvTextureStoreApi.canvasTexture(bitmap4.width, bitmap4.height);
106
156
  //第一个图
107
157
  let centerX = bitmap.width / 2;
108
158
  let centerY = bitmap.height / 2;
@@ -134,11 +184,26 @@ sourceId2.value = canvasRef2.commit();
134
184
  let customPath3 = canvasRef3.rectPath(3, 3, 133, 133);
135
185
  customPath3.stroke(6, "#87CEEB");
136
186
  sourceId3.value = canvasRef3.commit();
187
+ //第四个图(底色即使用渐变色接口描绘)
188
+ const multiColorSet = {
189
+ color: ["#ff0000", "#0000ff", "#00ff00", "#ff00ff"],
190
+ position: [0, 0.3, 0.8, 1],
191
+ };
192
+ canvasRef4.drawLinearGradientRect(
193
+ 0,
194
+ 0,
195
+ 0,
196
+ 136,
197
+ multiColorSet.color,
198
+ multiColorSet.position
199
+ );
200
+ sourceId4.value = canvasRef4.commit();
137
201
 
138
202
  onBeforeUnmount(() => {
139
203
  JsvTextureStoreApi.deleteTexture(sourceId.value);
140
204
  JsvTextureStoreApi.deleteTexture(sourceId2.value);
141
205
  JsvTextureStoreApi.deleteTexture(sourceId3.value);
206
+ JsvTextureStoreApi.deleteTexture(sourceId4.value);
142
207
  });
143
208
  </script>
144
209
 
@@ -157,12 +222,12 @@ onBeforeUnmount(() => {
157
222
  height: 300;
158
223
  background-color: #007f00;
159
224
  }
160
- .text{
161
- width:300;
162
- height:30;
225
+ .text {
226
+ width: 300;
227
+ height: 30;
163
228
  font-size: 28;
164
229
  line-height: 30;
165
- color: #FFFFFF;
230
+ color: #ffffff;
166
231
  text-align: center;
167
232
  }
168
233
  </style>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@shijiu/jsview-vue-samples",
3
- "version": "2.1.428",
3
+ "version": "2.1.448-test.0",
4
4
  "license": "MIT",
5
5
  "repository": "system/jsview-framework",
6
6
  "author": "mengxk",
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