forked from: RuntimeClass Sample #CustomDataStructure

by 9re forked from RuntimeClass Sample #CustomDataStructure (diff: 6)
♥0 | Line 26 | Modified 2009-09-16 01:39:54 | MIT License
play

ActionScript3 source code

/**
 * Copyright 9re ( http://wonderfl.net/user/9re )
 * MIT License ( http://www.opensource.org/licenses/mit-license.php )
 * Downloaded from: http://wonderfl.net/c/pVVl
 */

// forked from 9re's RuntimeClass Sample #CustomDataStructure
package  
{
    import Box2D.Common.Math.b2Vec2;
    import flash.display.BitmapData;
    import flash.display.Sprite;
    import flash.geom.Rectangle;
    public class Runtime_Sample_CustomDataStructure extends Sprite
    {
        public function Runtime_Sample_CustomDataStructure() 
        {
            trace("version 1");
        }
        
        public function drawBitmap($bitmap:BitmapData, $rect:Rectangle, $color:uint):void {
            $bitmap.fillRect($rect, $color);
        }
        
        public function getRectangle():Rectangle {
            return new Rectangle(20, 100, 20, 20);
        }
        
        public function getColor():uint {
            return 0xffff0000;
        }
        
        public function getVector():b2Vec2 {
            return new b2Vec2(20, 100);
        }
    }
    
}