|
@@ -12,21 +12,38 @@
|
|
|
|
|
|
<h1>[name]</h1>
|
|
|
|
|
|
- <div class="desc">A material for a [page:Sprite].</div>
|
|
|
+ <div class="desc">A material for a use with a [page:Sprite].</div>
|
|
|
|
|
|
+ <h2>Examples</h2>
|
|
|
+ <div>
|
|
|
+ [example:webgl_sprites WebGL / sprites]<br />
|
|
|
+ [example:misc_ubiquity_test misc / ubiquity / test]<br />
|
|
|
+ [example:misc_ubiquity_test2 misc / ubiquity / test2]<br />
|
|
|
+ [example:software_sandbox software / sandbox]<br />
|
|
|
+ [example:svg_sandbox svg / sandbox]<br />
|
|
|
+ [example:webgl_materials_cubemap_dynamic webgl / materials / cubemap / dynamic]
|
|
|
+ </div>
|
|
|
+
|
|
|
+ <code>
|
|
|
+var spriteMap = new THREE.TextureLoader().load( 'textures/sprite.png' );
|
|
|
+
|
|
|
+var spriteMaterial = new THREE.SpriteMaterial( { map: spriteMap, color: 0xffffff } );
|
|
|
|
|
|
- <h2>Constructor</h2>
|
|
|
+var sprite = new THREE.Sprite( spriteMaterial );
|
|
|
+sprite.scale.set(200, 200, 1)
|
|
|
+
|
|
|
+scene.add( sprite );
|
|
|
+
|
|
|
+ </code>
|
|
|
|
|
|
|
|
|
<h3>[name]( [page:Object parameters] )</h3>
|
|
|
<div>
|
|
|
- parameters -- an object defining the the default properties
|
|
|
- </div>
|
|
|
- <div>
|
|
|
- color - color of the sprite<br/>
|
|
|
- map - the texture map<br/>
|
|
|
- rotation - the rotation of the sprite<br/>
|
|
|
- fog - whether or not to use the scene fog<br/>
|
|
|
+ [page:Object parameters] - (optional) an object with one or more properties defining the material's appearance.
|
|
|
+ Any property of the material (including any property inherited from [page:Material]) can be passed in here.<br /><br />
|
|
|
+
|
|
|
+ The exception is the property [page:Hexadecimal color], which can be passed in as a hexadecimal
|
|
|
+ string and is *0xffffff* (white) by default. [page:Color.set]( color ) is called internally.
|
|
|
</div>
|
|
|
|
|
|
|
|
@@ -34,7 +51,13 @@
|
|
|
<div>See the base [page:Material] class for common properties.</div>
|
|
|
|
|
|
<h3>[property:Color color]</h3>
|
|
|
- <div>The texture is multiplied by this color. The default is 0xffffff</div>
|
|
|
+ <div>[page:Color] of the material, by default set to white (0xffffff). The [page:.map] is mutiplied by the color.</div>
|
|
|
+
|
|
|
+ <h3>[property:boolean fog]</h3>
|
|
|
+ <div>Whether or not this material affected by the scene's fog. Default is false</div>
|
|
|
+
|
|
|
+ <h3>[property:Boolean lights]</h3>
|
|
|
+ <div>Whether the material is affected by lights. Default is *false*.</div>
|
|
|
|
|
|
<h3>[property:Texture map]</h3>
|
|
|
<div>The texture map. Default is null.</div>
|
|
@@ -42,8 +65,8 @@
|
|
|
<h3>[property:Radians rotation]</h3>
|
|
|
<div>The rotation of the sprite in radians. Default is 0.</div>
|
|
|
|
|
|
- <h3>[property:boolean fog]</h3>
|
|
|
- <div>Whether or not this material affected by the scene's fog. Default is false</div>
|
|
|
+ <h2>Methods</h2>
|
|
|
+ <div>See the base [page:Material] class for common methods.</div>
|
|
|
|
|
|
<h2>Source</h2>
|
|
|
|