arcade2d
Enum

AssetType

assets/asset.constants.ts:15

The kind of resource an Asset wraps. The type determines which concrete Asset subclass an AssetLibrary produces when it loads a path, and which typed payload accessor that subclass exposes (e.g. ImageAsset.raw returns a texture for AssetType.Image).

The type is normally inferred from a path's file extension (see inferAssetType), but callers can override the inference per load when a URL has no usable extension — a CDN path, a query-string-suffixed URL, an extensionless route. See AssetLoadOptions.type.

Branch on the type to recover the concrete subclass and its payload accessor (see the class-level docs on Asset for the pattern).

Enumeration Members

#
Audio

An audio clip — MP3, OGG, WAV, M4A, AAC, FLAC, WebM, or Opus — decoded into a Web Audio AudioBuffer. Wrapped by AudioAsset and consumed by audio-playing components (AudioSource, Music).

#
Font

A font file — TTF, OTF, WOFF, or WOFF2 — loaded into a browser FontFace and registered on document.fonts so canvas-tier text can draw with it. Wrapped by FontAsset and consumed by Text.

#
Image

A raster image — PNG, JPEG, WebP, GIF, AVIF, BMP, or SVG — loaded into a GPU texture. Wrapped by ImageAsset and consumed by texture- and sprite-rendering components.

ESC