@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 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
- [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/xpadev_net/niconicomments/LICENSE)
2
+ [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](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.commentYOffset * comment.fontSize;
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
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@xpadev-net/niconicomments",
3
- "version": "0.0.5",
3
+ "version": "0.0.9",
4
4
  "description": "NiconiComments is a comment drawing library that is somewhat compatible with the official Nico Nico Douga player.",
5
5
  "main": "dist/bundle.js",
6
6
  "scripts": {