protected float _zoom; // Camera Zoom #endregion Fields #region Constructors public Camera2D(ConsoleManager console, bool addToConsole) { _zoom = 1.0f; _minZoom = 0.1f; _rotation = 0.0f; _pos = Vector2.Zero; if (addToConsole) console.HookInto(this); }
public CentauriGame(Game game) : base(game) { _inputService = (IInputService)game.Services.GetService(typeof(IInputService)); _uiService = (IUIService)game.Services.GetService(typeof(IUIService)); _animationService = (IAnimationService)game.Services.GetService(typeof(IAnimationService)); _spritebatch = (SpriteBatch)game.Services.GetService(typeof(SpriteBatch)); _consoleManager = (ConsoleManager)game.Services.GetService(typeof(ConsoleManager)); _content = (ContentController)game.Services.GetService(typeof(ContentController)); _eventManager = (EventManager) game.Services.GetService(typeof (EventManager)); }
public PlanetMapControl(IServiceProvider services) { _content = (ContentController)services.GetService(typeof(ContentController)); _spritebatch = (SpriteBatch)services.GetService(typeof(SpriteBatch)); _consoleManager = (ConsoleManager)services.GetService(typeof(ConsoleManager)); _black = _content.GetContent<Texture2D>(@"StarFields\black"); _font = _content.GetContent<SpriteFont>("Fonts/SpriteFont1"); Name = "PlanetMap"; ClipContent = true; BuildingCellSize = 128; }
public ConsoleWindow(ConsoleManager consoleManager) { Title = "Console"; Width = 480; Height = 600; Content = consoleManager.Console; IsVisible = false; CanResize = true; HideOnClose = true; }
private void LoadServices(IServiceProvider services) { _consoleManager = (ConsoleManager)services.GetService(typeof(ConsoleManager)); _galaxyManager = (GalaxyManager)services.GetService(typeof(GalaxyManager)); }
/// <summary> /// Allows the game to perform any initialization it needs to before starting to run. /// This is where it can query for any required services and load any non-graphic /// related content. Calling base.Initialize will enumerate through any components /// and initialize them as well. /// </summary> protected override void Initialize() { // TODO: Add your initialization logic here // The services are stored in Game.Services to make them accessible by all // game components. _spriteBatch = new SpriteBatch(GraphicsDevice); Services.AddService(typeof(SpriteBatch), _spriteBatch); Services.AddService(typeof(ContentManager), Content); // Add the input service, which manages device input, button presses, etc. _inputManager = new InputManager(false); Services.AddService(typeof(IInputService), _inputManager); // Add the UI service, which manages UI screens. _uiManager = new UIManager(this, _inputManager); Services.AddService(typeof(IUIService), _uiManager); // Add the animation service. _animationManager = new AnimationManager(); Services.AddService(typeof(IAnimationService), _animationManager); _consoleManager = new ConsoleManager(); Services.AddService(typeof(ConsoleManager), _consoleManager); _contentController = new ContentController(GraphicsDevice, Content); _contentController.LoadContent(); Services.AddService(typeof(ContentController), _contentController); _gameContentManager = new GameContentManager(Services); _gameContentManager.LoadGameContent(); Services.AddService(typeof(GameContentManager), _gameContentManager); _galaxyManager = new GalaxyManager(Services); Services.AddService(typeof(GalaxyManager), _galaxyManager); _gameManager = new GameManager(Services); _gameManager.NewGame(); Services.AddService(typeof(GameManager), _gameManager); _eventManager = new EventManager(); Services.AddService(typeof(EventManager), _eventManager); // ----- Add GameComponents // The component that shows the individual screen. Components.Add(new CentauriGame(this)); base.Initialize(); }