瀏覽代碼

Docs: Add code example for LoadingManager.addHandler().

Mugen87 5 年之前
父節點
當前提交
b26564e53e
共有 2 個文件被更改,包括 8 次插入0 次删除
  1. 4 0
      docs/api/en/loaders/managers/LoadingManager.html
  2. 4 0
      docs/api/zh/loaders/managers/LoadingManager.html

+ 4 - 0
docs/api/en/loaders/managers/LoadingManager.html

@@ -167,6 +167,10 @@
 		Registers a loader with the given regular expression. Can be used to define what loader should be used in
 		order to load specific files. A typical use case is to overwrite the default loader for textures.
 		</p>
+		<code>
+// add handler for TGA textures
+manager.addHandler( /\.tga$/i, new TGALoader() );
+		</code>
 
 		<h3>[method:null getHandler]( [param:String file] )</h3>
 		<p>

+ 4 - 0
docs/api/zh/loaders/managers/LoadingManager.html

@@ -165,6 +165,10 @@
 		Registers a loader with the given regular expression. Can be used to define what loader should be used in
 		order to load specific files. A typical use case is to overwrite the default loader for textures.
 		</p>
+		<code>
+// add handler for TGA textures
+manager.addHandler( /\.tga$/i, new TGALoader() );
+		</code>
 
 		<h3>[method:LoadingManager removeHandler]( [param:Object regex] )</h3>
 		<p>