public Game1() { graphics = new GraphicsDeviceManager(this); Content.RootDirectory = "Content"; //instantiate the components and add them to this.Components Vector3 cameraPosition = new Vector3(0, -3, 15); Vector3 targetPosition = new Vector3(0, -3, 0); Vector3 upVector = Vector3.UnitY; string backgroundImage = "background-cloth"; cameraComponent = new CameraComponent(this, cameraPosition, targetPosition, upVector, backgroundImage); this.Components.Add(cameraComponent); bool showMouse = true; inputComponent = new InputComponent(this, showMouse); this.Components.Add(inputComponent); }
internal void Initialize() { cameraComponent = (CameraComponent)game.Services.GetService(typeof(ICameraComponent)); }
public override void Initialize() { effect = new BasicEffect(game.GraphicsDevice, null); cameraComponent = (CameraComponent)game.Services.GetService(typeof(ICameraComponent)); base.Initialize(); }