NodeFrame.js 705 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758
  1. /**
  2. * @author sunag / http://www.sunag.com.br/
  3. */
  4. function NodeFrame( time ) {
  5. this.time = time !== undefined ? time : 0;
  6. this.id = 0;
  7. };
  8. NodeFrame.prototype = {
  9. constructor: NodeFrame,
  10. update: function ( delta ) {
  11. ++this.id;
  12. this.time += delta;
  13. this.delta = delta;
  14. return this;
  15. },
  16. setRenderer: function( renderer ) {
  17. this.renderer = renderer;
  18. return this;
  19. },
  20. setRenderTexture: function( renderTexture ) {
  21. this.renderTexture = renderTexture;
  22. return this;
  23. },
  24. updateNode: function ( node ) {
  25. if ( node.frameId === this.id ) return this;
  26. node.updateFrame( this );
  27. node.frameId = this.id;
  28. return this;
  29. }
  30. };
  31. export { NodeFrame };