77 lines
1.9 KiB
HTML
77 lines
1.9 KiB
HTML
|
|
<!DOCTYPE html>
|
||
|
|
<html lang="en">
|
||
|
|
<head>
|
||
|
|
<meta charset="utf-8" />
|
||
|
|
<base href="../../../" />
|
||
|
|
<script src="page.js"></script>
|
||
|
|
<link type="text/css" rel="stylesheet" href="page.css" />
|
||
|
|
</head>
|
||
|
|
<body>
|
||
|
|
<h1>[name]</h1>
|
||
|
|
|
||
|
|
<p class="desc">
|
||
|
|
A simple caching system, used internally by [page:FileLoader].
|
||
|
|
</p>
|
||
|
|
|
||
|
|
<h2>Code Example</h2>
|
||
|
|
|
||
|
|
<p>To enable caching across all loaders that use [page:FileLoader], set</p>
|
||
|
|
<code>
|
||
|
|
THREE.Cache.enabled = true.
|
||
|
|
</code>
|
||
|
|
|
||
|
|
|
||
|
|
<h2>Examples</h2>
|
||
|
|
|
||
|
|
<p>
|
||
|
|
[example:webgl_geometry_text WebGL / geometry / text ]<br />
|
||
|
|
[example:webgl_interactive_instances_gpu WebGL / interactive / instances / gpu]<br />
|
||
|
|
[example:webgl_loader_ttf WebGL / loader / ttf]
|
||
|
|
</p>
|
||
|
|
|
||
|
|
<h2>Properties</h2>
|
||
|
|
|
||
|
|
<h3>[property:Boolean enabled]</h3>
|
||
|
|
<p>Whether caching is enabled. Default is *false*.</p>
|
||
|
|
|
||
|
|
<h3>[property:Object files]</h3>
|
||
|
|
<p>An [page:Object object] that holds cached files.</p>
|
||
|
|
|
||
|
|
|
||
|
|
<h2>Methods</h2>
|
||
|
|
|
||
|
|
<h3>[method:null add]( [param:String key], [param:Object file] )</h3>
|
||
|
|
<p>
|
||
|
|
[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.
|
||
|
|
</p>
|
||
|
|
|
||
|
|
<h3>[method:null get]( [param:String key] )</h3>
|
||
|
|
<p>
|
||
|
|
[page:String key] — A string key <br /><br />
|
||
|
|
|
||
|
|
Get the value of [page:String key]. If the key does not exist *undefined* is returned.
|
||
|
|
</p>
|
||
|
|
|
||
|
|
<h3>[method:null remove]( [param:String key] )</h3>
|
||
|
|
<p>
|
||
|
|
[page:String key] — A string key that references a cached file.<br /><br />
|
||
|
|
|
||
|
|
Remove the cached file associated with the key.
|
||
|
|
</p>
|
||
|
|
|
||
|
|
<h3>[method:null clear]()</h3>
|
||
|
|
<p>Remove all values from the cache.</p>
|
||
|
|
|
||
|
|
|
||
|
|
<h2>Source</h2>
|
||
|
|
|
||
|
|
<p>
|
||
|
|
[link:https://github.com/mrdoob/three.js/blob/master/src/[path].js src/[path].js]
|
||
|
|
</p>
|
||
|
|
</body>
|
||
|
|
</html>
|