예제 #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);

            // TODO: use this.Content to load your game content here
            _ball1.LoadContent(Content.Load <Texture2D>("ball"));
            _ball2.LoadContent(Content.Load <Texture2D>("ball"));
        }
예제 #2
0
파일: Scene.cs 프로젝트: jvanmourik/pong
        // Load content
        public void LoadContent()
        {
            List <GameObject> gameObjects = rootNode.children;

            for (int i = 0; i < gameObjects.Count; i++)
            {
                if (gameObjects[i] is Sprite)
                {
                    Sprite sprite = (Sprite)gameObjects[i];
                    sprite.LoadContent();
                }
            }
        }