Esempio n. 1
0
        /// <summary>
        ///     Initializes the services.
        /// </summary>
        private void InitializeServices(GameServiceContainer services)
        {
            ResourceContents = new ResourceContentManager(services, "Content");
            services.AddService(typeof (ResourceContentManager), ResourceContents);

            Time = new TimeManager();
            services.AddService(typeof (TimeManager), Time);

            Camera = new CameraManager();
            services.AddService(typeof (CameraManager), Camera);

            Audio = new AudioManager();
            services.AddService(typeof (AudioManager), Audio);

            if (!windows)
            {
                DeviceManager = new GraphicsDeviceManager(Application);
                services.AddService(typeof (GraphicsDeviceManager), DeviceManager);
            }

            Settings = new Settings();
            services.AddService(typeof (Settings), Settings);

            Resources = new ResourceManager(ResourceContents);
            services.AddService(typeof (ResourceManager), Resources);

            Input = new InputManager();
            services.AddService(typeof (InputManager), Input);

            Scenes = new SceneManager();
            services.AddService(typeof (SceneManager), Scenes);

            InitializeExports();
        }
Esempio n. 2
0
        /// <summary>
        ///     Initializes the scene.
        /// </summary>
        internal virtual void Initialize()
        {
            state = SceneState.Default;

            input = Manager.Input;

            var settings = Manager.Settings;
            Interface = new RootControl
            {
                Active = true,
                Position = Vector2.Zero,
                Size = new Vector2(settings.Resolution.BaseWidth, settings.Resolution.BaseHeight),
                Parent = null
            };

            focus = Interface;

            OnInitialize();
        }