public override void LoadContent() { _song = Game.Content.Load<Song>("bgm/menuBgm"); _font = Game.Content.Load<SpriteFont>("Bauhaus"); _elements = Game.Content.Load<SoundEffect>("sfx/elements01"); _tutorial = Game.Content.Load<Texture2D>("img/tutorial"); MediaPlayer.Play(_song); _textBounds = new RotatableRectangleF(_font.MeasureString("[Enter] to Play")) { Center = new Vector2( x: .5f * Game.GraphicsDevice.PresentationParameters.BackBufferWidth, y: Game.GraphicsDevice.PresentationParameters.BackBufferHeight - 100) }; //Should be disposed :) _waiter = Wait.Until(time => { _textBounds.Rotation = (float) Math.Sin(time.Alive*MathHelper.TwoPi)*.25f; _textBounds.Scale = 1.5f*new Vector2( .5f + (float) Math.Sin((time.Alive*MathHelper.TwoPi)%MathHelper.Pi)); return false; }, null, -1); }
public Sprite(Animation animation) { Animation = animation; Body = new RotatableRectangleF(Animation.MaxDimensions); Flip = SpriteEffects.None; Tint = Color.White; FramesPerSecond = 30; if (Animation.Animations.Count == 1) { var keys = new string[1]; Animation.Animations.Keys.CopyTo(keys, 0); Key = keys[0]; } }
public void Setup(Vector2 dimensions) { Viewport = new RotatableRectangleF(dimensions); }