@next2d/player 1.18.12 → 2.0.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/README.md CHANGED
@@ -46,49 +46,55 @@ If Next2D is useful to you, we hope you will support our project.
46
46
 
47
47
  ## Related Sites
48
48
  * [Website](https://next2d.app)
49
- * [Player API Documentation](https://next2d.app/ja/docs/player)
50
- * [NoCode Tool](https://tool.next2d.app)
49
+ * [Animation Tool](https://tool.next2d.app)
51
50
  * [Framework](https://github.com/Next2D/framework)
52
51
 
53
52
  ## Examples
54
53
 
55
54
  ### Use Simple Sample
56
55
  ```javascript
57
- next2d.load("Path to JSON output from NoCode Tool");
56
+ next2d.load("Path to JSON output from Animation Tool");
58
57
  ```
59
- [CodePen](https://codepen.io/next2d/pen/rNGMrZG)
60
58
 
61
- ### Use Program Sample
59
+ ### Use Program Sample For JavaScript
62
60
  ```javascript
63
61
  const { Loader } = next2d.display;
64
62
  const { URLRequest } = next2d.net;
65
63
  const { Event } = next2d.events;
66
64
 
67
65
  // create root MovieClip
68
- const start = async () =>
66
+ const start = async () =>
69
67
  {
70
- const root = await next2d.createRootMovieClip();
71
-
72
68
  const request = new URLRequest("JSON path");
73
- const loader = new Loader(request);
74
-
75
- loader
76
- .contentLoaderInfo
77
- .addEventListener(Event.COMPLETE, (event) =>
78
- {
79
- root.addChild(event.currentTarget.content);
80
- });
81
-
82
- loader.load(request);
69
+ const loader = new Loader();
70
+ await loader.load(request);
71
+
72
+ const root = await next2d.createRootMovieClip();
73
+ root.addChild(loader.contentLoaderInfo.content);
83
74
  };
84
75
 
85
76
  start();
86
77
  ```
87
78
 
88
- ### Use Program Sample
79
+ ### Use Program Sample For TypeScript
80
+ ```typescript
81
+ import { Loader } from "@next2d/display";
82
+ import { URLRequest } from "@next2d/net";
83
+ import { Event } from "@next2d/events";
89
84
 
90
- [CodePen](https://codepen.io/next2d/pen/VwMKGEv)\
91
- @see [API Documentation](https://next2d.app/en/docs/player)
85
+ // create root MovieClip
86
+ const start = async (): Promise<void> =>
87
+ {
88
+ const request = new URLRequest("JSON path");
89
+ const loader = new Loader();
90
+ await loader.load(request);
91
+
92
+ const root = await next2d.createRootMovieClip();
93
+ root.addChild(loader.content);
94
+ };
95
+
96
+ start();
97
+ ```
92
98
 
93
99
  ## Option settings
94
100
 
@@ -96,7 +102,6 @@ start();
96
102
 
97
103
  | プロパティ名 | 型 | デフォルト値 | 説明 |
98
104
  |--------------|---------|---------------|-----------------------------------------------------------------------|
99
- | `base` | string | empty | 相対パスでJSONを取得する場合、ここで設定したURLがrootとして適用されます。絶対パスの場合はここで設定したURLは適用されません。 |
100
105
  | `fullScreen` | boolean | false | Stageクラスで設定した幅と高さを超えて画面全体に描画されます。 |
101
106
  | `tagId` | string | empty | IDを指定すると、指定したIDのエレメント内で描画を行います。 |
102
107
  | `bgColor` | string | "transparent" | 背景色を16進数で指定できます。デフォルトは無色透明です。 |
@@ -105,7 +110,6 @@ start();
105
110
 
106
111
  | name | type | default | description |
107
112
  |----------------|---------|---------------|-------------------------------------------------------------------------------------------------------------------------------------|
108
- | `base` | string | empty | When JSON is acquired by a relative path, the URL set here is applied as root. For absolute paths, the URL set here is not applied. |
109
113
  | `fullScreen` | boolean | false | The entire screen is drawn beyond the width and height set in the Stage class. |
110
114
  | `tagId` | string | empty | When an ID is specified, drawing is performed within the element of the specified ID. |
111
115
  | `bgColor` | string | "transparent" | You can specify a background color in hexadecimal. The default is colorless. |
@@ -114,7 +118,6 @@ start();
114
118
 
115
119
  | 名称 | 值类型 | 默认值 | 说明 |
116
120
  |--------------|---------|---------------|---------------------------------------------------|
117
- | `base` | string | empty | 当JSON是由相对路径获得的,这里设置的URL被应用为根。对于绝对路径,这里设置的URL不被应用。 |
118
121
  | `fullScreen` | boolean | false | 整个屏幕的绘制超出了Stage类中设置的宽度和高度。 |
119
122
  | `tagId` | string | empty | 当一个ID被指定时,在指定ID的元素内进行绘图。 |
120
123
  | `bgColor` | string | "transparent" | 你可以指定一个十六进制的背景颜色。默认为无色。 |