melonJS
    Preparing search index...

    Function setOptions

    • Sets the options for the loader.

      Parameters

      • options: { crossOrigin?: string; nocache?: boolean; withCredentials?: boolean }

        The options to set.

        • OptionalcrossOrigin?: string

          The crossOrigin attribute of the <video> and <script> elements and glTF images the loader creates ("anonymous" or "use-credentials"). Every other asset is always requested with CORS.

        • Optionalnocache?: boolean

          Enable or disable the nocache mechanism.

        • OptionalwithCredentials?: boolean

          Indicates whether or not cross-site Access-Control requests should be made using credentials. Requests to the game's own origin always carry them.

      Returns void

      // Set the crossOrigin attribute of the video and script elements to "anonymous"
      me.loader.setOptions({ crossOrigin: "anonymous" });

      // Enable the nocache mechanism
      me.loader.setOptions({ nocache: true });

      // Enable withCredentials
      me.loader.setOptions({ withCredentials: true });