@next2d/player 1.14.11 → 1.14.13

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.
@@ -2,7 +2,7 @@
2
2
  import { $currentPlayer, $initialize, $isSafari, $rendererWorker } from "./util/Util";
3
3
  import { Next2D } from "./player/Next2D";
4
4
  if (!("next2d" in window)) {
5
- console.log("%c Next2D Player %c 1.14.11 %c https://next2d.app", "color: #fff; background: #5f5f5f", "color: #fff; background: #4bc729", "");
5
+ console.log("%c Next2D Player %c 1.14.13 %c https://next2d.app", "color: #fff; background: #5f5f5f", "color: #fff; background: #4bc729", "");
6
6
  // @ts-ignore
7
7
  window.next2d = new Next2D([new Promise((resolve) => {
8
8
  if (document.readyState === "loading") {
@@ -32,7 +32,7 @@ export declare class GraphicsGradientFill {
32
32
  * @constructor
33
33
  * @private
34
34
  */
35
- constructor(type: GradientType, colors: number[], alphas: number[], ratios: number[], matrix?: Matrix | null, spread_method?: SpreadMethod, interpolation_method?: InterpolationMethod, focal_point_ratio?: number);
35
+ constructor(type: GradientType, colors: number[] | string[], alphas: number[], ratios: number[], matrix?: Matrix | null, spread_method?: SpreadMethod, interpolation_method?: InterpolationMethod, focal_point_ratio?: number);
36
36
  /**
37
37
  * @description 分配された色の情報を統合して配列で返却
38
38
  * Integrate the distributed color information and return it in an array.
@@ -1,4 +1,4 @@
1
- import { $getArray, $intToRGBA, $Math, $MATRIX_ARRAY_IDENTITY } from "../../util/RenderUtil";
1
+ import { $colorStringToInt, $getArray, $intToRGBA, $Math, $MATRIX_ARRAY_IDENTITY } from "../../util/RenderUtil";
2
2
  /**
3
3
  * グラデーション塗りを定義します。
4
4
  * Defines a gradient fill.
@@ -121,7 +121,11 @@ export class GraphicsGradientFill {
121
121
  if (!this._$colorStops.length) {
122
122
  const length = $Math.min($Math.min(this._$alphas.length, this._$colors.length), this._$ratios.length);
123
123
  for (let idx = 0; idx < length; ++idx) {
124
- const object = $intToRGBA(this._$colors[idx], this._$alphas[idx]);
124
+ const value = this._$colors[idx];
125
+ const color = typeof value === "string"
126
+ ? $colorStringToInt(value)
127
+ : value;
128
+ const object = $intToRGBA(color, this._$alphas[idx]);
125
129
  this._$colorStops[idx] = {
126
130
  "ratio": this._$ratios[idx] / 255,
127
131
  "R": object.R,
@@ -138,14 +138,17 @@ export class Next2D {
138
138
  this._$player.setOptions(options);
139
139
  this._$player._$initialize();
140
140
  const loader = new Loader();
141
- const loaderInfo = loader.contentLoaderInfo;
142
- loaderInfo.addEventListener(IOErrorEvent.IO_ERROR, (event) => {
141
+ loader
142
+ .contentLoaderInfo
143
+ .addEventListener(IOErrorEvent.IO_ERROR, (event) => {
143
144
  if (event.target) {
144
145
  event.target.removeEventListener(IOErrorEvent.IO_ERROR, event.listener);
145
146
  }
146
147
  alert("Error: " + event.text);
147
148
  });
148
- loaderInfo.addEventListener(Event.COMPLETE, (event) => {
149
+ loader
150
+ .contentLoaderInfo
151
+ .addEventListener(Event.COMPLETE, (event) => {
149
152
  const loaderInfo = event.target;
150
153
  const player = this._$player;
151
154
  loaderInfo
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@next2d/player",
3
- "version": "1.14.11",
3
+ "version": "1.14.13",
4
4
  "description": "Experience the fast and beautiful anti-aliased rendering of WebGL. You can create rich, interactive graphics, cross-platform applications and games without worrying about browser or device compatibility.",
5
5
  "author": "Toshiyuki Ienaga<ienaga@tvon.jp>",
6
6
  "license": "MIT",