/// <summary> /// Constructs a new screen manager component. /// </summary> public ScreenManager([NotNull] Game game) : base(game) { // we must set EnabledGestures before we can query for them, but // we don't assume the game wants to read them. TouchPanel.EnabledGestures = GestureType.None; this._gdm = new GraphicsDeviceManager(game); this._zoomWhilstWindowed = GetInitialZoom(); SetBackBufferSize(true); var playerInput = new PlayerInput(this.InputState); GlobalServices.SetPlayerInput(playerInput); }
public void Setup(Game game) { GlobalServices.SetGame(game); this.PlayerController = new PlayerController(game); game.Components.Add(this.PlayerController); GlobalServices.SetPlayerInput(this.PlayerController); var soundPlayer = new NullSoundPlayer(); GlobalServices.SetSoundPlayer(soundPlayer); var spriteLibrary = new DummySpriteLibrary(); GlobalServices.SetSpriteLibrary(spriteLibrary); }