You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/reference/apis.md
+62
Original file line number
Diff line number
Diff line change
@@ -221,6 +221,68 @@ Restores canvas strokes and internal data from existing strokes data.
221
221
tecack.restoreFromStrokes(strokes);
222
222
```
223
223
224
+
### Tecack.drawStrokeOrder()
225
+
226
+
It draws the stroke order on the strokes entered into the Canvas.
227
+
228
+
-#### Type
229
+
230
+
```ts
231
+
function drawStrokeOrder(options?:DrawStrokeOrderOptions):void|CanvasCtxNotFoundError;
232
+
```
233
+
234
+
-#### Example
235
+
236
+
```ts
237
+
tecack.drawStrokeOrder();
238
+
```
239
+
240
+
### DrawStrokeOrderOptions
241
+
242
+
Options for `Tecack.drawStrokeOrder()`
243
+
244
+
-#### Type
245
+
246
+
```ts
247
+
exportinterfaceDrawStrokeOrderOptions {
248
+
withColor?:boolean;
249
+
colorSet?:Array<string>;
250
+
}
251
+
```
252
+
253
+
#### DrawStrokeOrderOptions.withColor
254
+
255
+
When `withColor` is enabled, it draws each stroke in a different color.
256
+
This is to make it easier to understand which stroke order corresponds to which stroke.
257
+
Please refer to the `colorSet` to see which colors will be used for the drawing.
258
+
259
+
default: `false`
260
+
261
+
#### DrawStrokeOrderOptions.colorSet
262
+
263
+
This is the set of colors used when `withColor` is enabled.
264
+
The index of the color set (array) corresponds to the stroke order, and if the stroke order exceeds the length of the color set, it will cycle through.
265
+
266
+
::: warning
267
+
Please note that the colors (strings) registered as `colorSet`**must be six-digit hexadecimal numbers starting with `#`**.
268
+
(Shortened three-digit notation, specific color names, and rgb notation cannot be used.)
269
+
:::
270
+
271
+
default:
272
+
273
+
```ts
274
+
// prettier-ignore
275
+
/** based on https://kanjivg.tagaini.net/viewer.html */
0 commit comments