Per forza ti dà errore, non gli passi gli argomenti richiesti da Effect… Prova a spostare l'assegnazione del prototipo all'inerno del costruttore e a passargli gli argomenti, così:
P.S. Lo so che il concetto è molto simile alle classi, ma non le chiamare classi, in javascript si chiamano costruttori!codice:function Effect( vertexShader, fragmentShader, m_gl) { // blablabla } function MyEffect(vertexShader, fragmentShader, m_gl) { this._super(vertexShader, fragmentShader, m_gl); this.prototype = new Effect(vertexShader, fragmentShader, m_gl); } // MyEffect.prototype.constructor = Effect; // questo è superfluo, controlla da te! // alert(MyEffect.prototype.constructor); // piuttosto di solito, quando si modifica il prototipo, si reimposta il costruttore originale, così: MyEffect.prototype.constructor = MyEffect;![]()
![]()

Rispondi quotando