Guest User

Untitled

a guest
May 22nd, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. [code]
  2.         public function loadGraphics(Graphic:Array, Animated:Boolean=false, Reverse:Boolean=false, Width:uint=0, Height:uint=0, Unique:Boolean=false):FlxSprite {  
  3.             _bakedRotation = 0;
  4.                
  5.             for(var i:uint = 0; i < Graphic.lenght;i++) {
  6.                 var tmpPixels:BitmapData = FlxG.addBitmap(Graphic[i], Reverse, Unique);
  7.                 _pixels.merge(tmpPixels, new Rectangle(0, 0, tmpPixels.width, tmpPixels.height), new Point(_pixels.width, 0), 0, 0, 0, 0);
  8.             }  
  9.  
  10.             if(Reverse)
  11.                 _flipped = _pixels.width>>1;
  12.             else
  13.                 _flipped = 0;
  14.             if(Width == 0)
  15.             {  
  16.                 if(Animated)
  17.                     Width = _pixels.height;
  18.                 else if(_flipped > 0)
  19.                     Width = _pixels.width*0.5;
  20.                 else
  21.                     Width = _pixels.width;
  22.             }  
  23.             width = frameWidth = Width;
  24.             if(Height == 0)
  25.             {  
  26.                 if(Animated)
  27.                     Height = width;
  28.                 else
  29.                     Height = _pixels.height;
  30.             }  
  31.             height = frameHeight = Height;
  32.             resetHelpers();
  33.             return this;
  34.         }  
  35.  
  36. [/code]
Add Comment
Please, Sign In to add comment