Loader.html 3.1 KB
Newer Older
M
r59  
Mr.doob 已提交
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17
<!DOCTYPE html>
<html lang="en">
	<head>
		<meta charset="utf-8" />
		<script src="../../list.js"></script>
		<script src="../../page.js"></script>
		<link type="text/css" rel="stylesheet" href="../../page.css" />
	</head>
	<body>
		<h1>[name]</h1>

		<div class="desc">Base class for implementing loaders.</div>


		<h2>Constructor</h2>


M
r70  
Mr.doob 已提交
18
		<h3>[name]( [page:Boolean showStatus] )</h3>
M
r59  
Mr.doob 已提交
19
		<div>
M
r70  
Mr.doob 已提交
20
		[page:Boolean showStatus] — Show the status of loading div.
M
r59  
Mr.doob 已提交
21 22
		</div>
		<div>
M
r66  
Mr.doob 已提交
23
		Creates a new [name]. This should be called as base class.
M
r59  
Mr.doob 已提交
24 25 26 27 28
		</div>


		<h2>Properties</h2>

M
r69  
Mr.doob 已提交
29
		<h3>[property:Boolean showStatus]</h3>
M
r59  
Mr.doob 已提交
30
		<div>If true, show loading status in the statusDomElement.</div>
M
r70  
Mr.doob 已提交
31

M
r69  
Mr.doob 已提交
32
		<h3>[property:DOMElement statusDomElement]</h3>
M
r59  
Mr.doob 已提交
33
		<div>This is the recipient of status messages.</div>
M
r70  
Mr.doob 已提交
34

M
r69  
Mr.doob 已提交
35
		<h3>[property:Function onLoadStart]</h3>
M
r59  
Mr.doob 已提交
36 37 38
		<div>Will be called when load starts.</div>
		<div>The default is a function with empty body.</div>

M
r69  
Mr.doob 已提交
39
		<h3>[property:Function onLoadProgress]</h3>
M
r59  
Mr.doob 已提交
40 41
		<div>Will be called while load progresses.</div>
		<div>The default is a function with empty body.</div>
M
r70  
Mr.doob 已提交
42

M
r69  
Mr.doob 已提交
43
		<h3>[property:Function onLoadComplete]</h3>
M
r59  
Mr.doob 已提交
44 45
		<div>Will be called when load completes.</div>
		<div>The default is a function with empty body.</div>
M
r70  
Mr.doob 已提交
46

M
r69  
Mr.doob 已提交
47
		<h3>[property:string crossOrigin]</h3>
M
r59  
Mr.doob 已提交
48
		<div>
M
r66  
Mr.doob 已提交
49
		The crossOrigin string to implement CORS for loading the url from a different domain that allows CORS.
M
r70  
Mr.doob 已提交
50
		</div>
M
r59  
Mr.doob 已提交
51 52 53

		<h2>Methods</h2>

M
r70  
Mr.doob 已提交
54
		<h3>[method:Boolean needsTangents]( [page:Array materials] )</h3>
M
r59  
Mr.doob 已提交
55
		<div>
M
r70  
Mr.doob 已提交
56
		[page:Array materials] — an array of [page:Material]
M
r59  
Mr.doob 已提交
57 58
		</div>
		<div>
M
r66  
Mr.doob 已提交
59
		Checks if the loaded object needs tangents based on its materials.
M
r59  
Mr.doob 已提交
60 61
		</div>

M
r70  
Mr.doob 已提交
62
		<h3>[method:null updateProgress]( [page:object progress] )</h3>
M
r59  
Mr.doob 已提交
63
		<div>
M
r70  
Mr.doob 已提交
64
		[page:Object progress] — an object containing loaded(contains the amount of bytes loaded) and optionally total (containing the total amount of bytes).
M
r59  
Mr.doob 已提交
65 66
		</div>
		<div>
M
r66  
Mr.doob 已提交
67
		Updates the DOM object with the progress made.
M
r59  
Mr.doob 已提交
68 69
		</div>

M
r70  
Mr.doob 已提交
70
		<h3>[method:Material createMaterial]( [page:object m], [page:string texturePath] )</h3>
M
r59  
Mr.doob 已提交
71
		<div>
M
r70  
Mr.doob 已提交
72 73
		[page:Object m] — The parameters to create the material. <br />
		[page:String texturePath] — The base path of the textures.
M
r59  
Mr.doob 已提交
74 75
		</div>
		<div>
M
r66  
Mr.doob 已提交
76
		Creates the Material based on the parameters m.
M
r59  
Mr.doob 已提交
77 78
		</div>

M
r70  
Mr.doob 已提交
79
		<h3>[method:Array initMaterials]( [page:Array materials], [page:string texturePath] )</h3>
M
r59  
Mr.doob 已提交
80
		<div>
M
r70  
Mr.doob 已提交
81 82
		[page:Array materials] — an array of parameters to create materials. <br />
		[page:String texturePath] —  The base path of the textures.
M
r59  
Mr.doob 已提交
83 84
		</div>
		<div>
M
r66  
Mr.doob 已提交
85
		Creates an array of [page:Material] based on the array of parameters m. The index of the parameters decide the correct index of the materials.
M
r59  
Mr.doob 已提交
86 87
		</div>

M
r70  
Mr.doob 已提交
88
		<h3>[method:String extractUrlBase]( [page:string url] )</h3>
M
r59  
Mr.doob 已提交
89
		<div>
M
r70  
Mr.doob 已提交
90
		[page:String url] —  The url to extract the base url from.
M
r59  
Mr.doob 已提交
91 92
		</div>
		<div>
M
r70  
Mr.doob 已提交
93
		Extract the base from the URL.
M
r59  
Mr.doob 已提交
94 95
		</div>

M
r69  
Mr.doob 已提交
96
		<h3>[method:DOMElement addStatusElement]()</h3>
M
r59  
Mr.doob 已提交
97
		<div>
M
r70  
Mr.doob 已提交
98
		Add a DOM element to indicate the progress and return the DOMElement
M
r59  
Mr.doob 已提交
99 100 101 102 103 104 105 106
		</div>


		<h2>Source</h2>

		[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
	</body>
</html>