Advertisement
Guest User

Untitled

a guest
Oct 20th, 2014
228
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.87 KB | None | 0 0
  1. Paper.Component = function(){}; // useless unless I can solve problem mentioned below?
  2. Paper.Component.prototype = {
  3. isInBounds: function(x, y){
  4. // ...
  5. },
  6. setPosition: function(x, y){
  7. // ...
  8. },
  9. setSize: function(w, h){
  10. // ...
  11. }
  12. };
  13.  
  14. Paper.Button = function(x, y, w, h, text){
  15. // ...
  16. }
  17. Paper.Button.prototype = Object.create(Paper.Component.prototype);
  18.  
  19. Paper.Component = function(x,y,w,h){
  20. this.setPosition( x, y );
  21. this.setSize( w, h );
  22. };
  23. Paper.Component.prototype.isInBounds = function(x, y){};
  24. Paper.Component.prototype.setPosition = function(x, y){};
  25. Paper.Component.prototype.setSize = function(w, h){};
  26.  
  27. Paper.Button = function(x, y, w, h, text){
  28. Paper.Component.apply( this, arguments );
  29. }
  30. Paper.Button.prototype = Object.create(Paper.Component.prototype);
  31. Paper.Button.prototype.constructor = Paper.Button;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement