コード例 #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");
        }