API Docs for: 0.1.0
Show:

CG Module

CG is the base class of the cangaja framework. This file includes a requestAnimationFrame polyfill. It uses the simple javascript inheritance from John Resig.

Class example, how to start from scratch with simple inheritance


                        CG.Class.extend("Entity", {
                           init: function(){
                               this.myprop = 'set from constructor'
                           }
                        });
                        
                        CG.Entity.extend("Point",{
                           init: function(x, y){
                               this._super()
                               this.x = x
                               this.y = y
                           }
                        });
                        
                        CG.Point.extend("Rectangle",{
                           init: function(x, y, w, h){
                               this._super(x, y)
                               this.w = w
                               this.h = h
                           },
                           move: function(){
                           }
                        });