Class DroppedAssetFactory

Usage

const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);

Hierarchy

Constructors

Properties

credentials: undefined | InteractiveCredentials
jwt?: string
requestOptions: object
topia: Topia

Methods

  • Summary

    Instantiate a new instance of DroppedAsset class.

    Usage

    const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
    

    Parameters

    Returns DroppedAsset

  • Summary

    Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.

    Usage

    const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
    const droppedAssetInstance = await DroppedAsset.get(assetInstance, {
    assetScale: 1.5,
    flipped: true,
    layer0: "",
    layer1: "https://pathtoimage.png",
    interactivePublicKey,
    isInteractive: true,
    position: { x: 0, y: 0 },
    uniqueName: "exampleUniqueName",
    urlSlug,
    });

    Parameters

    • asset: Asset
    • __namedParameters: {
          assetScale?: number;
          clickType?: string;
          clickableDisplayTextDescription?: string;
          clickableDisplayTextHeadline?: string;
          clickableLink?: string;
          clickableLinkTitle?: string;
          flipped?: boolean;
          interactivePublicKey?: string;
          isForceLinkInIframe?: boolean;
          isInteractive?: boolean;
          isOpenLinkInDrawer?: boolean;
          isTextTopLayer?: boolean;
          layer0?: string;
          layer1?: string;
          position: {
              x: number;
              y: number;
          };
          sceneDropId?: string;
          text?: string;
          textColor?: string;
          textSize?: number;
          textWeight?: string;
          textWidth?: number;
          uniqueName?: string;
          urlSlug: string;
          yOrderAdjust?: number;
      }
      • Optional assetScale?: number
      • Optional clickType?: string
      • Optional clickableDisplayTextDescription?: string
      • Optional clickableDisplayTextHeadline?: string
      • Optional clickableLink?: string
      • Optional clickableLinkTitle?: string
      • Optional flipped?: boolean
      • Optional interactivePublicKey?: string
      • Optional isForceLinkInIframe?: boolean
      • Optional isInteractive?: boolean
      • Optional isOpenLinkInDrawer?: boolean
      • Optional isTextTopLayer?: boolean
      • Optional layer0?: string
      • Optional layer1?: string
      • position: {
            x: number;
            y: number;
        }
        • x: number
        • y: number
      • Optional sceneDropId?: string
      • Optional text?: string
      • Optional textColor?: string
      • Optional textSize?: number
      • Optional textWeight?: string
      • Optional textWidth?: number
      • Optional uniqueName?: string
      • urlSlug: string
      • Optional yOrderAdjust?: number

    Returns Promise<DroppedAsset>

  • Parameters

    • __namedParameters: {
          error?: unknown;
          message?: string;
          params?: object;
          sdkMethod?: string;
      }
      • Optional error?: unknown
      • Optional message?: string
      • Optional params?: object
      • Optional sdkMethod?: string

    Returns {
        data: {};
        message: string;
        method: string;
        params: object;
        sdkMethod: undefined | string;
        stack: string;
        stackTrace: Error;
        status: number;
        success: boolean;
        url: string;
    }

    • data: {}
      • message: string
      • method: string
      • params: object
      • sdkMethod: undefined | string
      • stack: string
      • stackTrace: Error
      • status: number
      • success: boolean
      • url: string
    • Summary

      Instantiate a new instance of DroppedAsset class and retrieve all properties.

      Usage

      const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, visitorId } });
      

      Parameters

      Returns Promise<DroppedAsset>

    • Summary

      Searches dropped assets within a world by a provide uniqueName. If a single match is found, a new instance of DroppedAsset class is returned all properties.

      Usage

      const droppedAssetInstance = await DroppedAsset.getWithUniqueName("exampleUniqueName", urlSlug, interactiveSecret, credentials);
      

      Parameters

      • uniqueName: string
      • urlSlug: string
      • interactiveSecret: string
      • credentials: {
            apiKey?: string;
            interactiveNonce?: string;
            interactivePublicKey: string;
            visitorId?: number;
        }
        • Optional apiKey?: string
        • Optional interactiveNonce?: string
        • interactivePublicKey: string
        • Optional visitorId?: number

      Returns Promise<DroppedAsset>

    • Returns AxiosInstance