/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. _spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here _font = Content.Load<SpriteFont>("spriteFont1"); _soundPool = new SoundPool(5, Stream.Music, 0); AssetFileDescriptor assetFileDescriptor; assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/boom.wav"); _soundBoom = _soundPool.Load(assetFileDescriptor, 1); assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/ouch.wav"); _soundOuch = _soundPool.Load(assetFileDescriptor, 1); _btnBoom = new ButtonSprite(); _btnBoom.Initialize(_font, Content.Load<Texture2D>("Graphics\\ButtonActive"), Content.Load<Texture2D>("Graphics\\ButtonInactive")); _btnBoom.Position = new Vector2(150, 200); _btnBoom.TextureScale = new Vector2(2f, 0.5f); _btnBoom.Text = "Boom"; _btnBoom.TextOffset = new Vector2(40, 20); _buttons.Add(_btnBoom); _btnOuch = new ButtonSprite(); _btnOuch.Initialize(_font, Content.Load<Texture2D>("Graphics\\ButtonActive"), Content.Load<Texture2D>("Graphics\\ButtonInactive")); _btnOuch.Position = new Vector2(600, 200); _btnOuch.TextureScale = new Vector2(2f, 0.5f); _btnOuch.Text = "Ouch"; _btnOuch.TextOffset = new Vector2(40, 20); _buttons.Add(_btnOuch); _focusManager.SelectedButton = _btnBoom; _focusManager.Mappings[_btnBoom] = new FocusManager.ButtonMapping() { Right = _btnOuch }; _focusManager.Mappings[_btnOuch] = new FocusManager.ButtonMapping() { Left = _btnBoom, }; }
/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); // TODO: use this.Content to load your game content here font = Content.Load<SpriteFont>("spriteFont1"); m_soundPool = new SoundPool(5, Stream.Music, 0); AssetFileDescriptor assetFileDescriptor; assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/ouch.wav"); m_soundBoom = m_soundPool.Load(assetFileDescriptor, 1); assetFileDescriptor = Activity.ApplicationContext.Assets.OpenFd("Content/boom.wav"); m_soundOuch = m_soundPool.Load(assetFileDescriptor, 1); }
/// <summary> /// Load all sounds. /// </summary> private void loadSound() { Stream st = new Stream(); sp = new SoundPool(1, st, 0); SoundPushButton = sp.Load(this, Resource.Raw.clickInMenu, 1); }
/// <summary> /// Loads all sound variables. /// </summary> private void loadSounds() { Stream st = new Stream(); sp = new SoundPool(1, st, 100); sp2 = new SoundPool(1, st, 100); sp3 = new SoundPool(1, st, 100); _soundPushButton = sp.Load(this, Resource.Raw.buttonDown, 1); _singleRowOrColumn = sp2.Load(this, Resource.Raw.singleRowOrColumn, 1); _gameOver = sp3.Load(this, Resource.Raw.gameOver, 1); }