Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- [code]
- public function loadGraphics(Graphic:Array, Animated:Boolean=false, Reverse:Boolean=false, Width:uint=0, Height:uint=0, Unique:Boolean=false):FlxSprite {
- _bakedRotation = 0;
- for(var i:uint = 0; i < Graphic.lenght;i++) {
- var tmpPixels:BitmapData = FlxG.addBitmap(Graphic[i], Reverse, Unique);
- _pixels.merge(tmpPixels, new Rectangle(0, 0, tmpPixels.width, tmpPixels.height), new Point(_pixels.width, 0), 0, 0, 0, 0);
- }
- if(Reverse)
- _flipped = _pixels.width>>1;
- else
- _flipped = 0;
- if(Width == 0)
- {
- if(Animated)
- Width = _pixels.height;
- else if(_flipped > 0)
- Width = _pixels.width*0.5;
- else
- Width = _pixels.width;
- }
- width = frameWidth = Width;
- if(Height == 0)
- {
- if(Animated)
- Height = width;
- else
- Height = _pixels.height;
- }
- height = frameHeight = Height;
- resetHelpers();
- return this;
- }
- [/code]
Add Comment
Please, Sign In to add comment