import Entity from "./Entity"; import Scene from "./Scene"; import { Vector2, Vector3 } from "./GeoMath"; import GeoPoint from "./GeoPoint"; import { ImageIconLoader, IconLoaderItem } from "./IconLoader"; import BindingBlock from "./animation/BindingBlock"; import Resource from "./Resource"; import AbstractPointEntity from "./AbstractPointEntity"; /** * 画像アイコンエンティティ */ declare class ImageIconEntity extends AbstractPointEntity { private _primitive_producer; private _parent_props; private _alpha_clipping; private _alpha_clip_threshold; private _mask_color?; /** * @param scene 所属可能シーン * @param opts オプション集合 */ constructor(scene: Scene, opts?: ImageIconEntity.Option); /** */ getPrimitiveProducer(): ImageIconEntity.PrimitiveProducer; /** * EasyBindingBlock.DescendantUnbinder 処理 */ private _unbindDescendantAnimations; /** * アニメーションの BindingBlock を初期化 */ private _setupAnimationBindingBlock; /** * アイコンのサイズを指定 * @param size アイコンのピクセルサイズ */ setSize(size: Vector2): void; /** * アイコンの原点位置を指定 * @param origin アイコンの原点位置 */ setOrigin(origin: Vector2): void; /** * Add Image Icon * @param image_src 画像 * @param position 位置 * @param props プロパティ * @return 追加したEntry */ addImageIcon(image_src: string | HTMLImageElement | HTMLCanvasElement, position: GeoPoint, props?: ImageIconEntity.ImageEntryOption): ImageIconEntity.ImageEntry; /** * 専用マテリアルを取得 */ private _getMaterial; private _setValueProperty; private _setVector2Property; private _setupByJson; /** * IDでEntryを取得 * @param id ID * @return IDが一致するEntry(無ければundefined) */ getEntry(id: string): ImageIconEntity.ImageEntry | undefined; } declare namespace ImageIconEntity { const DEFAULT_COLOR: Vector3; const SAFETY_PIXEL_MARGIN = 1; const MAX_IMAGE_WIDTH = 4096; const CIRCLE_SEP_LENGTH = 32; const DEFAULT_ICON_SIZE: Vector2; const DEFAULT_ORIGIN: Vector2; const DEFAULT_ALPHA_CLIP_THRESHOLD = 0.5; interface Option extends Entity.Option { json?: ImageIconEntity.Json; /** * アルファクリップ有効フラグ * 追加した画像全てに適応されます * 省略時はtrue */ alpha_clipping?: boolean; /** * アルファクリッピングの閾値 * 省略時は0.5 */ alpha_clip_threshold?: number; /** * マスク色(0 ~ 255) * 追加した画像全てに適応されます */ mask_color?: Vector3; /** * マスク色(0.0 ~ 1.0) * 追加した画像全てに適応されます */ mask_color_normalized?: Vector3; } class Props { json?: ImageIconEntity.Json; transform?: Resource.TransformCallback; [key: string]: any; } interface Json extends Entity.Json { entries: ImageIconJson[]; size?: Vector2; origin?: Vector2; } interface ImageIconJson { image_src: string; position: [x: number, y: number]; /** アイコンサイズ */ size?: Vector2; /** Entryを識別するID */ id?: string; /** URL変換関数 */ transform?: Resource.TransformCallback; } interface ImageEntryProps { /** アイコンサイズ */ size?: Vector2; /** Entryを識別するID */ id?: string; /** URL変換関数 */ transform?: Resource.TransformCallback; origin?: Vector2; [key: string]: any; } interface ImageEntryOption { /** アイコンサイズ */ size?: Vector2; /** Entryを識別するID */ id?: string; /** URL変換関数 */ transform?: Resource.TransformCallback; origin?: Vector2; } /** * 要素 */ class ImageEntry extends AbstractPointEntity.Entry { private _owner; private _position; private _props; private _icon; private _image_src; private _animation; /** * @param owner 所有者 * @param image_src アイコン画像 * @param position 位置 * @param props プロパティ */ constructor(owner: ImageIconEntity, image_src: string | HTMLImageElement | HTMLCanvasElement, position: GeoPoint, props: ImageEntryOption); get animation(): BindingBlock; /** * ID */ get id(): string; /** * アニメーションの BindingBlock を初期化 */ private _setupAnimationBindingBlock; /** * 画像のパスを設定 * @param image_src 画像のパス */ setImage(image_src: HTMLCanvasElement | HTMLImageElement | string): void; /** * テキスト原点位置を設定 * * @param position テキスト原点の位置 */ setPosition(position: GeoPoint): void; /** * アイコンのサイズを指定 * @param size アイコンのピクセルサイズ */ setSize(size: Vector2): void; /** */ private _copyPropertyVector3f; /** */ private _copyPropertyVector2f; /** */ private _setVector2Property; isLoaded(): boolean; get icon(): IconLoaderItem; draw(context: CanvasRenderingContext2D, x: number, y: number, width: number, height: number): void; } const iconLoader: ImageIconLoader; } export default ImageIconEntity; //# sourceMappingURL=ImageIconEntity.d.ts.map