예제 #1
0
파일: Game1.cs 프로젝트: ks222rt/1DV437
        /// <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
파일: BallView.cs 프로젝트: shjelm/1DV437
        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");
        }