Last change
on this file since 28897 was 28897, checked in by davidb, 10 years ago |
GUI front-end to server base plus web page content
|
File size:
820 bytes
|
Rev | Line | |
---|
[28897] | 1 | /**
|
---|
| 2 | * @author mrdoob / http://mrdoob.com/
|
---|
| 3 | *
|
---|
| 4 | * parameters = {
|
---|
| 5 | * color: <hex>,
|
---|
| 6 | * program: <function>,
|
---|
| 7 | * opacity: <float>,
|
---|
| 8 | * blending: THREE.NormalBlending
|
---|
| 9 | * }
|
---|
| 10 | */
|
---|
| 11 |
|
---|
| 12 | THREE.SpriteCanvasMaterial = function ( parameters ) {
|
---|
| 13 |
|
---|
| 14 | THREE.Material.call( this );
|
---|
| 15 |
|
---|
| 16 | this.color = new THREE.Color( 0xffffff );
|
---|
| 17 | this.program = function ( context, color ) {};
|
---|
| 18 |
|
---|
| 19 | this.setValues( parameters );
|
---|
| 20 |
|
---|
| 21 | };
|
---|
| 22 |
|
---|
| 23 | THREE.SpriteCanvasMaterial.prototype = Object.create( THREE.Material.prototype );
|
---|
| 24 |
|
---|
| 25 | THREE.SpriteCanvasMaterial.prototype.clone = function () {
|
---|
| 26 |
|
---|
| 27 | var material = new THREE.SpriteCanvasMaterial();
|
---|
| 28 |
|
---|
| 29 | THREE.Material.prototype.clone.call( this, material );
|
---|
| 30 |
|
---|
| 31 | material.color.copy( this.color );
|
---|
| 32 | material.program = this.program;
|
---|
| 33 |
|
---|
| 34 | return material;
|
---|
| 35 |
|
---|
| 36 | };
|
---|
| 37 |
|
---|
| 38 | // backwards compatibility
|
---|
| 39 |
|
---|
| 40 | THREE.ParticleCanvasMaterial = THREE.SpriteCanvasMaterial; |
---|
Note:
See
TracBrowser
for help on using the repository browser.