Thank you to anyone who has already donated - your generous donations helped make three months of treatment possible.
My brother Nate continues to fight stage IV Hodgkin's lymphoma. He's just 31, with a wife and baby girl. They have no active income (since he's been unable to return to work), no insurance, and cannot afford the treatment he needs. Nate and his family need your help. Please consider a donation, every dollar helps. Thanks.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 |
{ { Texture = texture; Scale = 1f; Origin = new Vector2(texture.Width/2f, texture.Height/2f); Children = new List<Sprite>(); } public Vector2 Position { get; set; } public float Rotation { get; set; } public float Scale { get; set; } public Vector2 Origin { get; set; } public Texture2D Texture { get; private set; } public List<Sprite> Children { get; private set; } { Draw(spriteBatch, Matrix.Identity); } { return Matrix.CreateTranslation(-Origin.X, -Origin.Y, 0f) * Matrix.CreateScale(Scale, Scale, 1f) * Matrix.CreateRotationZ(Rotation) * Matrix.CreateTranslation(Position.X, Position.Y, 0f); } { Matrix globalTransform = CalculateLocalTransform() * parentTransform; Vector2 position, scale; float rotation; DecomposeMatrix(ref globalTransform, out position, out rotation, out scale); spriteBatch.Draw(Texture, position, null, Color.White, rotation, Vector2.Zero, scale, SpriteEffects.None, 0.0f); Children.ForEach(c => c.Draw(spriteBatch, globalTransform)); } { Vector3 position3, scale3; Quaternion rotationQ; matrix.Decompose(out scale3, out rotationQ, out position3); Vector2 direction = Vector2.Transform(Vector2.UnitX, rotationQ); rotation = (float)Math.Atan2(direction.Y, direction.X); position = new Vector2(position3.X, position3.Y); scale = new Vector2(scale3.X, scale3.Y); } } } |