Namespace: collie

collie

Classes

Animation
AnimationCycle
AnimationDelay
AnimationQueue
AnimationRepeat
AnimationTimeline
AnimationTransition
Box2d
Circle
Component
ComponentEvent
DisplayObject
FPSConsole
ImageNumber
Layer
LayerEvent
Map
MovableObject
PathFinding
Polyline
Pool
Rectangle
Sensor
Text

Namespaces

Effect
ImageManager
Matrix
Profiling
Renderer
Timer
Transform
util

Members

staticcollie.version

자동 치환되므로 직접 수정하지 않는다.

Methods

Class(o, oParent){collie.Class}

클래스 만들기

Name Type Description
o Object

클래스 멤버, $init을 이용해 생성자를 정의할 수 있다.

oParent collie.Class

상속받을 부모 클래스

Examples
var Person = collie.Class({
 gender : false,
 walk : function () { return "walking!"; }
});

var Male = collie.Class({
 name : "",
 gender : "male"
}, Person);

var oDavid = new Male();
oDavid.name = "david";

alert(oDavid.name); // david
alert(oDavid.gender); // male
alert(oDavid.walk()); // walking!

override

var Person = collie.Class({
 testMethod : function () {

 }
});

var Male = collie.Class({
 testMethod : function () {
     // blah
     this.constructor.$super.testMethod.apply(this, arguments);      
 }
}, Person);

You can also use create a instance without 'new' keyword

var Person = collie.Class({
 $init : function () {
 },
 test : function () {
 }
});

var a = new Person();
var b = Person(); // It works fine!
comments powered by Disqus