|
@@ -12,35 +12,48 @@
|
|
|
|
|
|
<h1>[name]</h1>
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">A sprite is a plane in an 3d scene which faces always towards the camera.<br /><br />Sprites do not cast shadows, setting <code>castShadow = true</code> will have no effect.</div>
|
|
|
|
|
|
+ <div class="desc">
|
|
|
|
+ A sprite is a plane that always faces towards the camera, generally with a
|
|
|
|
+ partially transparent texture applied.<br /><br />
|
|
|
|
|
|
- <h2>Example</h2>
|
|
|
|
|
|
+ Sprites do not cast shadows, setting <code>castShadow = true</code> will have no effect.
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <h2>Example</h2>
|
|
|
|
|
|
- <code>
|
|
|
|
- var map = new THREE.TextureLoader().load( "sprite.png" );
|
|
|
|
- var material = new THREE.SpriteMaterial( { map: map, color: 0xffffff, fog: true } );
|
|
|
|
- var sprite = new THREE.Sprite( material );
|
|
|
|
- scene.add( sprite );
|
|
|
|
- </code>
|
|
|
|
|
|
+ <code>
|
|
|
|
+var spriteMap = new THREE.TextureLoader().load( "sprite.png" );
|
|
|
|
+var spriteMaterial = new THREE.SpriteMaterial( { map: spriteMap, color: 0xffffff } );
|
|
|
|
+var sprite = new THREE.Sprite( spriteMaterial );
|
|
|
|
+scene.add( sprite );
|
|
|
|
+ </code>
|
|
|
|
|
|
|
|
|
|
<h2>Constructor</h2>
|
|
<h2>Constructor</h2>
|
|
|
|
|
|
<h3>[name]( [page:Material material] )</h3>
|
|
<h3>[name]( [page:Material material] )</h3>
|
|
<div>
|
|
<div>
|
|
- material — An instance of [page:Material] (optional).
|
|
|
|
- </div>
|
|
|
|
- <div>
|
|
|
|
- This creates a new sprite with an specific material.
|
|
|
|
|
|
+ [page:Material material] - (optional) an instance of [page:SpriteMaterial]. Default is a white [page:SpriteMaterial].<br /><br />
|
|
|
|
+
|
|
|
|
+ Creates a new [name].
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
<h2>Properties</h2>
|
|
<h2>Properties</h2>
|
|
<div>See the base [page:Object3D] class for common properties.</div>
|
|
<div>See the base [page:Object3D] class for common properties.</div>
|
|
|
|
|
|
|
|
+ <h3>[property:Boolean isSprite]</h3>
|
|
|
|
+ <div>
|
|
|
|
+ Used to check whether this or derived classes are sprites. Default is *true*.<br /><br />
|
|
|
|
+
|
|
|
|
+ You should not change this, as it used internally for optimisation.
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+
|
|
<h3>[property:SpriteMaterial material]</h3>
|
|
<h3>[property:SpriteMaterial material]</h3>
|
|
<div>
|
|
<div>
|
|
- An instance of [page:Material], defining the object's appearance. Default is a [page:SpriteMaterial] which is a white plane.
|
|
|
|
|
|
+ An instance of [page:SpriteMaterial], defining the object's appearance.
|
|
|
|
+ Default is a white [page:SpriteMaterial].
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|
|
@@ -49,7 +62,13 @@
|
|
|
|
|
|
<h3>[method:Sprite clone]()</h3>
|
|
<h3>[method:Sprite clone]()</h3>
|
|
<div>
|
|
<div>
|
|
- Returns a clone of this Sprite object and its descendants.
|
|
|
|
|
|
+ Returns a clone of this Sprite object and any descendants.
|
|
|
|
+ </div>
|
|
|
|
+
|
|
|
|
+ <h3>[method:Array raycast]( [page:Raycaster raycaster], [page:Array intersects] )</h3>
|
|
|
|
+ <div>
|
|
|
|
+ Get intersections between a casted ray and this sprite.
|
|
|
|
+ [page:Raycaster.intersectObject] will call this method.
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
|