Example #1
0
        private void constructor(float X, float Y, Texture2D SimpleGraphic)
        {
            x = X;
            y = Y;

            _flashRect = new Rectangle();
            _flashRect2 = new Rectangle();
            _flashPointZero = new Point();
            offset = new Point();

            scale = 1f;
            _alpha = 1;
            _color = Color.White;
            blend = null;
            antialiasing = false;

            finished = false;
            facing = Flx2DFacing.NotUsed;
            _animations = new List<FlxAnim>();
            _flipped = 0;
            _curAnim = null;
            _curFrame = 0;
            _caf = 0;
            _frameTimer = 0;

            //_mtx = new Matrix();
            _callback = null;
            //if (_gfxSprite == null)
            //{
            //    _gfxSprite = new Sprite();
            //    _gfx = _gfxSprite.graphics;
            //}

            if (SimpleGraphic == null)
                createGraphic(8, 8, color);
            else
                loadGraphic(SimpleGraphic);
        }
Example #2
0
 /**
  * Pass in a function to be called whenever this sprite's animation changes.
  *
  * @param	AnimationCallback		A function that has 3 parameters: a string name, a uint frame number, and a uint frame index.
  */
 public void addAnimationCallback(FlxAnimationCallback ac)
 {
     _callback = ac;
 }