/// <summary> /// FlxSprite private constructor /// </summary> /// <param name="X"></param> /// <param name="Y"></param> /// <param name="SimpleGraphic"></param> private void constructor(float X, float Y, Texture2D SimpleGraphic) { x = X; y = Y; originalPosition.X = X; originalPosition.Y = Y; _flashRect = new Rectangle(); _flashRect2 = new Rectangle(); _flashPointZero = new Point(); offset = new Point(); scale = 1f; _alpha = 1; _color = Color.White; _lastColor = 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; boundingBoxOverride = true; _colorFlicker = false; _colorFlickerTimer = -1; //_mtx = new Matrix(); _callback = null; //if (_gfxSprite == null) //{ // _gfxSprite = new Sprite(); // _gfx = _gfxSprite.graphics; //} if (SimpleGraphic == null) { createGraphic(8, 8, color); } else { loadGraphic(SimpleGraphic); } }
/// <summary> /// Pass in a function to be called on each frame change or animation change. /// </summary> /// <param name="ac">A function that has 3 parameters: a string name, a uint frame number, and a uint frame index. /// <para>Should look like this.</para> /// <para>public void pr(string Name, uint Frame, int FrameIndex)</para></param> public void addAnimationCallback(FlxAnimationCallback ac) { _callback = ac; }
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); }
/** * 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; }