Browse Source

Improved Cache doc

looeee 8 years ago
parent
commit
6ae87a50d1
1 changed files with 29 additions and 28 deletions
  1. 29 28
      docs/api/loaders/Cache.html

+ 29 - 28
docs/api/loaders/Cache.html

@@ -10,61 +10,62 @@
 	<body>
 		<h1>[name]</h1>
 
-		<div class="desc">A simple caching classe, used internaly by [page:FileLoader].</div>
-
+		<div class="desc">
+			A simple caching system, used internally by [page:FileLoader].
+		</div>
 
-		<h2>Constructor</h2>
+		<h2>Examples</h2>
 
-		<h3>[name]()</h3>
 		<div>
-		Creates a new [name].
+			[example:webgl_geometry_text_earcut WebGL / geometry / text / earcut]<br />
+			[example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]<br />
+			[example:webgl_loader_ttf WebGL / loader / ttf]
 		</div>
 
+		<h2>Usage</h2>
+
+		<div>To enable caching  across all loaders	derived from [page:FileLoader], set</div>
+		<code>
+THREE.Cache.enabled = true.
+		</code>
+
 
 		<h2>Properties</h2>
 
 		<h3>[property:Boolean enabled]</h3>
-		<div>
-		Whether caching is enabled. Default is *false*.
-		</div>
+		<div>Whether caching is enabled. Default is *false*.</div>
 
 		<h3>[property:Object files]</h3>
-		<div>
-		An [page:Object object] that hold cached values.
-		</div>
+		<div>An [page:Object object] that holds cached files.</div>
 
 
 		<h2>Methods</h2>
 
-		<h3>[method:null add]( [page:String key], value )</h3>
-		<div>
-		[page:String key] — required. A string key <br />
-		[page:Object] value — A value <br />
-		</div>
+		<h3>[method:null add]( [page:String key], file )</h3>
 		<div>
-		Adds a cache entry with that key to hold the value. If this key already holds a value, it is overwritten.
+		[page:String key] — the [page:String key] to reference the cached file by.<br />
+		[page:Object file] — The file to be cached.<br /><br />
+
+		Adds a cache entry with a key to reference the file. If this key already holds a file,
+		it is overwritten.
 		</div>
 
 		<h3>[method:null get]( [page:String key] )</h3>
 		<div>
-		[page:String key] — required. A string key <br />
-		</div>
-		<div>
-		Get the value of key. If the key does not exist *undefined* is returned.
+		[page:String key] — A string key <br /><br />
+
+		Get the value of [page:String key]. If the key does not exist *undefined* is returned.
 		</div>
 
 		<h3>[method:null remove]( [page:String key] )</h3>
 		<div>
-		[page:String key] — required. A string key <br />
-		</div>
-		<div>
-		Remove the cached value associated with the key.
+		[page:String key] — A string key that references a cached file.<br /><br />
+
+		Remove the cached file associated with the key.
 		</div>
 
 		<h3>[method:null clear]()</h3>
-		<div>
-		Remove all values from the cache.
-		</div>
+		<div>Remove all values from the cache.</div>
 
 
 		<h2>Source</h2>