Пример #1
0
        /// <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);

            Camera camera = new Camera(GraphicsDevice.Viewport);
            ballView = new BallView(ballSimulation, camera, GraphicsDevice, Content.Load<Texture2D>("ball"));
        }
Пример #2
0
        public BallView(GraphicsDevice graphicsDevice, ContentManager content)
        {
            windowWidth = graphicsDevice.Viewport.Width;
            windowHeight = graphicsDevice.Viewport.Height;
            camera = new Camera(windowHeight, windowWidth);

            this.spriteBatch = new SpriteBatch(graphicsDevice);
            texture = content.Load<Texture2D>("ball");
            borderTexture = content.Load<Texture2D>("border");
        }