浏览代码

Improved doc for TextureLoader

looeee 8 年之前
父节点
当前提交
357084b394
共有 2 个文件被更改,包括 44 次插入8 次删除
  1. 4 0
      docs/api/loaders/CubeTextureLoader.html
  2. 40 8
      docs/api/loaders/TextureLoader.html

+ 4 - 0
docs/api/loaders/CubeTextureLoader.html

@@ -64,6 +64,10 @@ scene.background = new THREE.CubeTextureLoader()
 			The [page:LoadingManager loadingManager] the loader is using. Default is [page:DefaultLoadingManager].
 		</div>
 
+		<h3>[property:String path]</h3>
+		<div>The base path from which files will be loaded. See [page:.setPath]. Default is *undefined*.</div>
+
+
 
 		<h2>Methods</h2>
 

+ 40 - 8
docs/api/loaders/TextureLoader.html

@@ -10,7 +10,10 @@
 	<body>
 		<h1>[name]</h1>
 
-		<div class="desc">Class for loading a [page:Texture texture].</div>
+		<div class="desc">
+			Class for loading a [page:Texture texture].
+			This uses the [page:ImageLoader] internally for loading files.
+		</div>
 
 		<h2>Example</h2>
 
@@ -46,9 +49,8 @@
 
 		<h3>[name]( [page:LoadingManager manager] )</h3>
 		<div>
-		[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].
-		</div>
-		<div>
+		[page:LoadingManager manager] — The [page:LoadingManager loadingManager] for the loader to use. Default is [page:LoadingManager THREE.DefaultLoadingManager].<br /><br />
+
 		Creates a new [name].
 		</div>
 
@@ -57,10 +59,25 @@
 
 		<h3>[property:String crossOrigin]</h3>
 		<div>
-		default — *null*.<br />
-		If set, assigns the *crossOrigin* attribute of the image to the value of *crossOrigin*, prior to starting the load.
+		If set, assigns the [link:https://developer.mozilla.org/en-US/docs/Web/HTML/CORS_settings_attributes crossOrigin]
+	 attribute of the image to the value of *crossOrigin*, prior to starting the load. Default is *undefined*.
+		</div>
+
+
+		<h3>[property:LoadingManager manager]</h3>
+		<div>
+			The [page:LoadingManager loadingManager]  the loader is using. Default is [page:DefaultLoadingManager].
 		</div>
 
+		<h3>[property:String path]</h3>
+		<div>The base path from which files will be loaded. See [page:.setPath]. Default is *undefined*.</div>
+
+
+		<h3>[property:String withCredentials]</h3>
+		<div>
+			Whether the XMLHttpRequest uses credentials - see [page:.setWithCredentials].
+			Default is *undefined*.
+		</div>
 
 		<h2>Methods</h2>
 
@@ -69,12 +86,27 @@
 		[page:String url] — required<br />
 		[page:Function onLoad] — Will be called when load completes. The argument will be the loaded [page:Texture texture].<br />
 		[page:Function onProgress] — Will be called while load progresses. The argument will be the XmlHttpRequest instance, that contain .[page:Integer total] and .[page:Integer loaded] bytes.<br />
-		[page:Function onError] — Will be called when load errors.<br />
+		[page:Function onError] — Will be called when load errors.<br /><br />
+
+		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
 		</div>
+
+		<h3>[method:null setCrossOrigin]( [page:String value] )</h3>
+		<div>Set the [page:.crossOrigin] attribute.</div>
+
+		<h3>[method:FileLoader setPath]( [page:String path] )</h3>
 		<div>
-		Begin loading from url and pass the loaded [page:Texture texture] to onLoad.
+			Set the base path or URL from which to load files. This can be useful if
+			you are loading many models from the same directory.
 		</div>
 
+		<h3>[method:FileLoader setWithCredentials]( [page:Boolean value] )</h3>
+		Whether the XMLHttpRequest uses credentials such as cookies, authorization headers or
+		TLS client certificates. See
+		[link:https://developer.mozilla.org/en-US/docs/Web/API/XMLHttpRequest/withCredentials XMLHttpRequest.withCredentials].<br />
+		Note that this has no effect if you are loading files locally or from the same domain.
+		<div>
+
 		<h2>Source</h2>
 
 		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]