RTSDK
    Preparing search index...

    Class DroppedAssetFactory

    const DroppedAsset = new DroppedAssetFactory(myTopiaInstance);
    

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

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

    Methods

    • Instantiate a new instance of DroppedAsset class.

      Parameters

      Returns DroppedAsset

      Returns a new DroppedAsset object.

      const droppedAssetInstance = await DroppedAsset.create(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
      
    • Drops an asset in a world and returns a new instance of DroppedAsset class with all properties.

      Parameters

      • asset: Asset
      • __namedParameters: {
            assetScale?: number;
            clickableDisplayTextDescription?: string;
            clickableDisplayTextHeadline?: string;
            clickableLink?: string;
            clickableLinkTitle?: string;
            clickType?: 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;
            textFontFamily?: string;
            textSize?: number;
            textWeight?: string;
            textWidth?: number;
            uniqueName?: string;
            urlSlug: string;
            yOrderAdjust?: number;
        }

      Returns Promise<DroppedAsset>

      Returns a new DroppedAsset object with all properties.

      const assetInstance = await Asset.create(id, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, 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

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

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

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

      Parameters

      Returns Promise<DroppedAsset>

      Returns a new DroppedAsset object with all properties.

      const droppedAssetInstance = await DroppedAsset.get(assetId, urlSlug, { credentials: { interactiveNonce, interactivePublicKey, assetId, urlSlug, visitorId } });
      
    • 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.

      Parameters

      Returns Promise<DroppedAsset>

      Returns a new DroppedAsset object with all properties.

      This method leverages the handleGetDroppedAssetByUniqueName endpoint in the Public API and assumes there is exactly one dropped asset with matching uniqueName for the given urlSlug.

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