@akashic/akashic-engine
Advanced tools
Comparing version 3.1.2 to 3.2.0-feature.0
@@ -1,2 +0,2 @@ | ||
import { AudioAsset, ImageAsset, ScriptAsset, TextAsset } from "@akashic/pdi-types"; | ||
import { AudioAsset, ImageAsset, ScriptAsset, TextAsset, VectorImageAsset } from "@akashic/pdi-types"; | ||
import { AssetManager } from "./AssetManager"; | ||
@@ -77,2 +77,11 @@ /** | ||
/** | ||
* パスから読み込み済みのベクタ画像アセットを取得する。 | ||
* | ||
* パスはgame.jsonのあるディレクトリをルート (`/`) とする、 `/` 区切りの絶対パスでなければならない。 | ||
* 当該のベクタ画像アセットが読み込まれていない場合、エラー。 | ||
* | ||
* @param path 取得する画像アセットのパス | ||
*/ | ||
getVectorImage(path: string): VectorImageAsset; | ||
/** | ||
* 与えられたパターンまたはフィルタにマッチするパスを持つ、読み込み済みの全画像アセットを取得する。 | ||
@@ -115,2 +124,9 @@ * | ||
/** | ||
* 与えられたパターンまたはフィルタにマッチするパスを持つ、読み込み済みの全ベクタ画像アセットを取得する。 | ||
* 引数の仕様については `AssetAccessor#getAllImages()` の仕様を参照のこと。 | ||
* | ||
* @param patternOrFilter 取得するベクタ画像アセットのパスパターンまたはフィルタ。省略した場合、読み込み済みの全て | ||
*/ | ||
getAllVectorImages(patternOrFilter?: string | ((path: string) => boolean)): VectorImageAsset[]; | ||
/** | ||
* アセットIDから読み込み済みの画像アセットを取得する。 | ||
@@ -157,2 +173,9 @@ * 当該の画像アセットが読み込まれていない場合、エラー。 | ||
getJSONContentById(assetId: string): any; | ||
/** | ||
* アセットIDから読み込み済みのベクタ画像アセットを取得する。 | ||
* 当該のベクタ画像アセットが読み込まれていない場合、エラー。 | ||
* | ||
* @param assetId 取得するベクタ画像アセットのID | ||
*/ | ||
getVectorImageById(assetId: string): VectorImageAsset; | ||
} |
@@ -91,2 +91,13 @@ "use strict"; | ||
/** | ||
* パスから読み込み済みのベクタ画像アセットを取得する。 | ||
* | ||
* パスはgame.jsonのあるディレクトリをルート (`/`) とする、 `/` 区切りの絶対パスでなければならない。 | ||
* 当該のベクタ画像アセットが読み込まれていない場合、エラー。 | ||
* | ||
* @param path 取得する画像アセットのパス | ||
*/ | ||
AssetAccessor.prototype.getVectorImage = function (path) { | ||
return this._assetManager.peekLiveAssetByAccessorPath(path, "vector-image"); | ||
}; | ||
/** | ||
* 与えられたパターンまたはフィルタにマッチするパスを持つ、読み込み済みの全画像アセットを取得する。 | ||
@@ -137,2 +148,11 @@ * | ||
/** | ||
* 与えられたパターンまたはフィルタにマッチするパスを持つ、読み込み済みの全ベクタ画像アセットを取得する。 | ||
* 引数の仕様については `AssetAccessor#getAllImages()` の仕様を参照のこと。 | ||
* | ||
* @param patternOrFilter 取得するベクタ画像アセットのパスパターンまたはフィルタ。省略した場合、読み込み済みの全て | ||
*/ | ||
AssetAccessor.prototype.getAllVectorImages = function (patternOrFilter) { | ||
return this._assetManager.peekAllLiveAssetsByPattern(patternOrFilter !== null && patternOrFilter !== void 0 ? patternOrFilter : "**/*", "vector-image"); | ||
}; | ||
/** | ||
* アセットIDから読み込み済みの画像アセットを取得する。 | ||
@@ -191,4 +211,13 @@ * 当該の画像アセットが読み込まれていない場合、エラー。 | ||
}; | ||
/** | ||
* アセットIDから読み込み済みのベクタ画像アセットを取得する。 | ||
* 当該のベクタ画像アセットが読み込まれていない場合、エラー。 | ||
* | ||
* @param assetId 取得するベクタ画像アセットのID | ||
*/ | ||
AssetAccessor.prototype.getVectorImageById = function (assetId) { | ||
return this._assetManager.peekLiveAssetById(assetId, "vector-image"); | ||
}; | ||
return AssetAccessor; | ||
}()); | ||
exports.AssetAccessor = AssetAccessor; |
import { AssetConfigurationMap, AudioSystemConfigurationMap, ModuleMainScriptsMap } from "@akashic/game-configuration"; | ||
import { Asset, AssetLoadHandler, AudioAsset, AssetLoadError, ImageAsset, ResourceFactory, ScriptAsset, TextAsset, VideoAsset } from "@akashic/pdi-types"; | ||
import { Asset, AssetLoadHandler, AudioAsset, AssetLoadError, ImageAsset, ResourceFactory, ScriptAsset, TextAsset, VideoAsset, VectorImageAsset } from "@akashic/pdi-types"; | ||
import { AssetManagerLoadHandler } from "./AssetManagerLoadHandler"; | ||
import { AudioSystemManager } from "./AudioSystemManager"; | ||
import { DynamicAssetConfiguration } from "./DynamicAssetConfiguration"; | ||
export declare type OneOfAsset = AudioAsset | ImageAsset | ScriptAsset | TextAsset | VideoAsset; | ||
export declare type OneOfAsset = AudioAsset | ImageAsset | ScriptAsset | TextAsset | VideoAsset | VectorImageAsset; | ||
export interface AssetManagerParameterGameLike { | ||
@@ -8,0 +8,0 @@ resourceFactory: ResourceFactory; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.AssetManager = void 0; | ||
var EmptyVectorImageAsset_1 = require("./auxiliary/EmptyVectorImageAsset"); | ||
var ExceptionFactory_1 = require("./ExceptionFactory"); | ||
@@ -374,2 +375,8 @@ var VideoSystem_1 = require("./VideoSystem"); | ||
} | ||
if (conf.type === "vector-image") { | ||
if (typeof conf.width !== "number") | ||
throw ExceptionFactory_1.ExceptionFactory.createAssertionError("AssetManager#_normalize: wrong width given for the vector-image asset: " + p); | ||
if (typeof conf.height !== "number") | ||
throw ExceptionFactory_1.ExceptionFactory.createAssertionError("AssetManager#_normalize: wrong height given for the vector-image asset: " + p); | ||
} | ||
if (!conf.global) | ||
@@ -419,2 +426,7 @@ conf.global = false; | ||
return resourceFactory.createVideoAsset(id, uri, conf.width, conf.height, videoSystem, !!conf.loop, !!conf.useRealSize); | ||
case "vector-image": | ||
if (!resourceFactory.createVectorImageAsset) { | ||
return new EmptyVectorImageAsset_1.EmptyVectorImageAsset(id, uri, conf.width, conf.height, conf.hint); | ||
} | ||
return resourceFactory.createVectorImageAsset(id, uri, conf.width, conf.height, conf.hint); | ||
default: | ||
@@ -421,0 +433,0 @@ throw ExceptionFactory_1.ExceptionFactory.createAssertionError("AssertionError#_createAssetFor: unknown asset type " + conf.type + " for asset ID: " + id); |
{ | ||
"name": "@akashic/akashic-engine", | ||
"version": "3.1.2", | ||
"version": "3.2.0-feature.0", | ||
"description": "The core library of Akashic Engine", | ||
"main": "index.js", | ||
"dependencies": { | ||
"@akashic/game-configuration": "~1.0.1", | ||
"@akashic/pdi-types": "~1.2.0", | ||
"@akashic/game-configuration": "~1.1.0-feature.0", | ||
"@akashic/pdi-types": "~1.3.0-feature.0", | ||
"@akashic/playlog": "~3.1.0", | ||
@@ -14,3 +14,3 @@ "@akashic/trigger": "~1.0.0" | ||
"@akashic/eslint-config": "0.1.1", | ||
"@akashic/pdi-common-impl": "0.0.4", | ||
"@akashic/pdi-common-impl": "0.2.0-feature.1", | ||
"@types/jest": "^25.1.5", | ||
@@ -63,3 +63,4 @@ "@typescript-eslint/eslint-plugin": "^3.10.1", | ||
"publishConfig": { | ||
"@akashic:registry": "https://registry.npmjs.org/" | ||
"@akashic:registry": "https://registry.npmjs.org/", | ||
"tag": "feature" | ||
}, | ||
@@ -66,0 +67,0 @@ "typings": "lib/index.d.ts", |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is too big to display
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
1205812
159
25080
2
+ Added@akashic/game-configuration@1.1.0(transitive)
+ Added@akashic/pdi-types@1.3.1(transitive)
- Removed@akashic/amflow@3.0.0(transitive)
- Removed@akashic/game-configuration@1.0.1(transitive)
- Removed@akashic/pdi-types@1.1.11.2.0(transitive)