Sha256: e3ea91f32f0255a5f71321f254f6de27fe78ebccc1c1226d0b43da28bc58c63a

Contents?: true

Size: 614 Bytes

Versions: 2

Compression:

Stored size: 614 Bytes

Contents

/*
The circle component draws a rectangle on screen.
*/
re.c('circle')
.requires('draw')
.defaults({
    color:'#82d5f4'
})
.defines({
    
    draw:function(c){
        
        c.fillStyle = this.color;
        
        c.beginPath();
        
            c.arc(-this.regX + this.sizeX * 0.5, -this.regY + this.sizeX * 0.5, this.sizeX, 0, Math.PI*2, true);
        
        c.closePath();
        
        c.fill();
        return this;
    },
    
    radius:function(r){
        if(re.is(r)){
            this.sizeX = this.sizeY = r;
            return this;
        }
        return this.sizeX;
    }
    
});

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
entityjs-0.3.1 src/display/circle.js
entityjs-0.3.0 src/display/circle.js