@xpadev-net/niconicomments 0.0.5 → 0.0.9
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/LICENSE +3 -7
- package/README.md +5 -1
- package/dist/bundle.js +9 -1
- package/package.json +1 -1
package/LICENSE
CHANGED
|
@@ -1,11 +1,7 @@
|
|
|
1
|
-
The MIT License
|
|
2
|
-
===============
|
|
3
|
-
|
|
4
1
|
Copyright (c) 2021 xpadev https://xpadev.net
|
|
5
2
|
|
|
6
|
-
|
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
|
|
7
4
|
|
|
8
|
-
|
|
5
|
+
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
|
|
9
6
|
|
|
10
|
-
|
|
11
|
-
作者または著作権者は、契約行為、不法行為、またはそれ以外であろうと、ソフトウェアに起因または関連し、あるいはソフトウェアの使用またはその他の扱いによって生じる一切の請求、損害、その他の義務について何らの責任も負わないものとします。
|
|
7
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
package/README.md
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
# [niconicomments](https://xpadev.net/niconicomments/)
|
|
2
|
-
[](https://github.com/
|
|
2
|
+
[](https://github.com/xpadev-net/niconicomments/blob/master/LICENSE)
|
|
3
3
|
ニコニコ動画の公式プレイヤーに多少の互換性を持つコメント描画ライブラリです
|
|
4
4
|
This is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.
|
|
5
5
|
Reference: https://xpadev.net/niconicomments/docs/
|
|
@@ -9,6 +9,10 @@ Github: https://github.com/xpadev-net/niconicomments
|
|
|
9
9
|
```html
|
|
10
10
|
<script src="https://cdn.jsdelivr.net/npm/niconicomments@latest/src/main.min.js"></script>
|
|
11
11
|
```
|
|
12
|
+
or
|
|
13
|
+
```
|
|
14
|
+
npm i @xpadev-net/niconicomments
|
|
15
|
+
```
|
|
12
16
|
|
|
13
17
|
## Examples
|
|
14
18
|
```javascript
|
package/dist/bundle.js
CHANGED
|
@@ -30,6 +30,7 @@
|
|
|
30
30
|
|
|
31
31
|
this.showCollision = false;
|
|
32
32
|
this.showFPS = false;
|
|
33
|
+
this.showCommentCount = false;
|
|
33
34
|
this.timeline = {};
|
|
34
35
|
this.nicoScripts = {
|
|
35
36
|
"reverse": []
|
|
@@ -448,7 +449,7 @@
|
|
|
448
449
|
} else if (comment.loc === "shita") {
|
|
449
450
|
for (let i in lines) {
|
|
450
451
|
let line = lines[i];
|
|
451
|
-
let posY = 1080 - (comment.posY + comment.height) + i * comment.fontSize + this.
|
|
452
|
+
let posY = 1080 - (comment.posY + comment.height) + i * comment.fontSize - this.commentYMarginTop * comment.fontSize + this.commentYMarginTop * comment.fontSize;
|
|
452
453
|
this.context.strokeText(line, posX, posY);
|
|
453
454
|
this.context.fillText(line, posX, posY);
|
|
454
455
|
}
|
|
@@ -701,6 +702,13 @@
|
|
|
701
702
|
this.context.strokeText("FPS:" + this.fps, 100, 100);
|
|
702
703
|
this.context.fillText("FPS:" + this.fps, 100, 100);
|
|
703
704
|
}
|
|
705
|
+
|
|
706
|
+
if (this.showCommentCount) {
|
|
707
|
+
this.context.font = parseFont("defont", 60, this.useLegacy);
|
|
708
|
+
this.context.fillStyle = "#00FF00";
|
|
709
|
+
this.context.strokeText("Count:" + this.timeline[vpos].length, 100, 200);
|
|
710
|
+
this.context.fillText("Count:" + this.timeline[vpos].length, 100, 200);
|
|
711
|
+
}
|
|
704
712
|
}
|
|
705
713
|
/**
|
|
706
714
|
* キャンバスを消去する
|
package/package.json
CHANGED