/// <summary> /// LoadContent will be called once per game and is the place to load /// all of your content. /// </summary> protected override void LoadContent() { // Create a new SpriteBatch, which can be used to draw textures. spriteBatch = new SpriteBatch(GraphicsDevice); ballSimulation = new BallSimulation(); ballView = new BallView(graphics, Content, ballSimulation); // TODO: use this.Content to load your game content here }
// ContentManager content; // GraphicsDeviceManager graphics; // SpriteBatch spriteBatch; public BallView(GraphicsDeviceManager graphics, ContentManager content, BallSimulation ballSimulation) { box = new Texture2D(graphics.GraphicsDevice, 1, 1); box.SetData <Color>(new Color[] { Color.White }); camera = new Camera(graphics.GraphicsDevice.Viewport); globe = content.Load <Texture2D>("globe.png"); m_ballSimulation = ballSimulation; }
// ContentManager content; // GraphicsDeviceManager graphics; // SpriteBatch spriteBatch; public BallView(GraphicsDeviceManager graphics, ContentManager content, BallSimulation ballSimulation) { box = new Texture2D(graphics.GraphicsDevice, 1, 1); box.SetData<Color>(new Color[] { Color.White }); camera = new Camera(graphics.GraphicsDevice.Viewport); globe = content.Load<Texture2D>("globe.png"); m_ballSimulation = ballSimulation; }