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(){
}
});
This module provides the following classes:
- Cangaja
- CG.Animation
- CG.AtlasImage
- CG.AtlasTexturePacker
- CG.B2DBridge
- CG.B2DChainShape
- CG.B2DCirlce
- CG.B2DEntity
- CG.B2DFizzXLoader
- CG.B2DLine
- CG.B2DPolygon
- CG.B2DRectangle
- CG.B2DRope
- CG.B2DTerrain
- CG.B2DWorld
- CG.Bitmap
- CG.Bound
- CG.Buffer
- CG.Button
- CG.CanvasRenderer
- CG.Delta
- CG.Director
- CG.Emitter
- CG.Entity
- CG.Font
- CG.Game
- CG.GameController
- CG.Layer
- CG.Map
- CG.MapArea
- CG.MapPoint
- CG.MapTileLayer
- CG.MapTileProperties
- CG.MediaAsset
- CG.Menu
- CG.Morph
- CG.Particle
- CG.Point
- CG.Screen
- CG.Sequence
- CG.SpineAnimation
- CG.Sprite
- CG.Stick
- CG.Text
- CG.Translate
- CG.Vector