/// <summary> /// A transition between two scenes /// </summary> /// <param name="game">The game</param> public TransitionScreen(ScreenManager sceneManager) { SetBasicParams(sceneManager); texture = CreateBlankTexture(sceneManager); color = Color.Black; }
public TransitionScreen(ScreenManager sceneManager, Texture2D texture) { SetBasicParams(sceneManager); this.texture = texture; color = Color.White; }
/// <summary> /// Abstract Scene. Inherit from this to create your scenes /// </summary> /// <param name="sceneManager">The SceneManager</param> /// <param name="name">The name of the Scene</param> public GameScreen(ScreenManager sceneManager, String name) { this.Name = name; this.sceneManager = sceneManager; this.spriteBatch = sceneManager.SpriteBatch; this.centerScreen = new Vector2( sceneManager.Game.GraphicsDevice.Viewport.Width / 2, sceneManager.Game.GraphicsDevice.Viewport.Height / 2); }
public Cloud(ScreenManager sceneManager) { viewport = sceneManager.Game.GraphicsDevice.Viewport; textura = sceneManager.Game.Content.Load<Texture2D>(@"cloud"); posicao.X = RandomHelper.RandomInt(-startx, viewport.Width); posicao.Y = RandomHelper.RandomInt(-starty, viewport.Height / 3); escala = RandomHelper.RandomFloat(0.2f, 0.7f); velocidade = RandomHelper.RandomFloat(0.01f, 0.07f); flip = (SpriteEffects)RandomHelper.RandomInt(0, 2); direcao = (Direcao)RandomHelper.RandomInt(-1, 1); if (direcao == 0) direcao = (Direcao)1; }
private void SetBasicParams(ScreenManager sceneManager) { this.sceneManager = sceneManager; spriteBatch = sceneManager.SpriteBatch; viewport = sceneManager.Game.GraphicsDevice.Viewport; InProgress = true; }
private Texture2D CreateBlankTexture(ScreenManager sceneManager) { Texture2D t = new Texture2D(sceneManager.Game.GraphicsDevice, 1, 1, false, SurfaceFormat.Color); Color[] data = new Color[t.Width * t.Height]; for (int i = 0; i < data.Length; i++) data[i] = Color.White; t.SetData(data); return t; }
/// <summary> /// A Menu Scene /// </summary> /// <param name="game">The game</param> public MenuSceen(ScreenManager sceneManager, string name) : base(sceneManager, name) { // Fonte a ser usada para escrever na tela; font = sceneManager.Game.Content.Load<SpriteFont>("font"); // Gera nuvens aleatórias nuvens = new Cloud[RandomHelper.RandomInt(10,50)]; for (int i = 0; i < nuvens.Length; i++) { nuvens[i] = new Cloud(sceneManager); } }