AssetPathInfo

ceramic.AssetPathInfo (Class)

Information extracted from a raw asset path.

This class parses asset file paths to extract metadata including:

  • Density information (e.g., @2x, @3x)
  • File extension
  • Normalized asset name
  • Flags for conditional loading

Path parsing examples:

  • hero.png -> name: "hero", extension: "png", density: 1.0
  • hero@2x.png -> name: "hero", extension: "png", density: 2.0
  • hero@2x+retina.png -> name: "hero", extension: "png", density: 2.0, flags: {retina: true}
  • ui/button+hover+pressed.png -> name: "ui/button", flags: {hover: true, pressed: true}
  • icon+size=large.png -> name: "icon", flags: {size: "large"}
See: Assets.decodePath

Instance Members

density: Float

Density value resolved from file name. Example: If file is named someImage@2x.png, density will be 2. Default density is 1


extension: String

File extension (always converted to lowercase for convenience)


name: String

Normalized asset name (includes subdirectories relative to asset root). Example: both someImage.png and someImage@2x.png will resolve to a same asset name someImage


path: String

Original path used to generated path info


flags: Map

Flags are extracted from file path. Example: file someFile+myTag.txt will generate myTag flag.


new(path: String): Void

Parse an asset path to extract metadata.

Name Type Description
path String The asset file path to parse

Private Members

toString(): String

String representation for debugging.

Returns Description
String Object-like string with all parsed properties