예제 #1
0
        public void LoadContent()
        {
            // Create a new SpriteBatch, which can be used to draw textures.
            _spriteBatch = new SpriteBatch(_game.GraphicsDevice);
            _infoPanel   = new InfoPanel(ContentRepository, _screen);

            _music.AddSong("the_lift", ContentRepository.LoadSong("Music/the_lift"));
            _music.AddSoundEffect("explode", ContentRepository.LoadSoundEffect("Sounds/explode"));
            _music.AddSoundEffect("star", ContentRepository.LoadSoundEffect("Sounds/floop"));

            _tile   = ContentRepository.LoadTexture("Textures/tile");
            _effect = ContentRepository.LoadEffect("Effects/Tunnel"
#if ANDROID
                                                   + ".android"
#endif
                                                   );

            _tunnel         = new Tunnel(32, _effect, _tile);
            _player         = new Player(ContentRepository, _game, _camera, _tunnel);
            _player.Visible = false;

            _elemManager = new ElementManager(ContentRepository, _sceneInterface, _game, _camera, _tunnel, _player, _music);
            angleUpdate  = 0;

            _font[0]      = ContentRepository.LoadFont("Fonts/Ubuntu12");
            _font[1]      = ContentRepository.LoadFont("Fonts/Ubuntu24");
            _font[2]      = ContentRepository.LoadFont("Fonts/Ubuntu36");
            _font[3]      = ContentRepository.LoadFont("Fonts/Ubuntu48");
            _font[4]      = ContentRepository.LoadFont("Fonts/Ubuntu64");
            _fontIcons[0] = ContentRepository.LoadFont("Fonts/Awesome12");
            _fontIcons[1] = ContentRepository.LoadFont("Fonts/Awesome24");
            _fontIcons[2] = ContentRepository.LoadFont("Fonts/Awesome36");
            _fontIcons[3] = ContentRepository.LoadFont("Fonts/Awesome48");
            _fontIcons[4] = ContentRepository.LoadFont("Fonts/Awesome64");
        }
예제 #2
0
        public UIEngine(ContentRepository contentRepo, GraphicsDevice device)
        {
            Content     = contentRepo;
            Device      = device;
            MusicPlayer = new MusicPlayer();

            Screen = new Screen(device.Viewport.Width, device.Viewport.Height, /* 960 */ (int)(((float)720 / (float)device.Viewport.Height) * device.Viewport.Width), 720, 0, 0);

            MusicPlayer.AddSoundEffect("click", contentRepo.LoadSoundEffect("Sounds/click"));
            MusicPlayer.AddSoundEffect("hover", contentRepo.LoadSoundEffect("Sounds/hover"));

            Instance = this;
        }