LoadContent() 공개 메소드

public LoadContent ( Microsoft.Xna.Framework.Content.ContentManager theContentManager, string theAssetName ) : void
theContentManager Microsoft.Xna.Framework.Content.ContentManager
theAssetName string
리턴 void
예제 #1
0
파일: SpriteTest.cs 프로젝트: aslone/Team18
 public void LoadContentTest()
 {
     Sprite target = new Sprite(); // TODO: Initialize to an appropriate value
     ContentManager theContentManager = null; // TODO: Initialize to an appropriate value
     string theAssetName = string.Empty; // TODO: Initialize to an appropriate value
     target.LoadContent(theContentManager, theAssetName);
     Assert.Inconclusive("A method that does not return a value cannot be verified.");
 }
예제 #2
0
파일: Game1.cs 프로젝트: rcorre/idea-game
        /// <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
            mBackground.LoadContent(this.Content, "Background");
            mBackground.Scale = 2.0f;

            mPlayer.LoadContent(this.Content);
            mPlayer.Scale = 0.8f;
        }
예제 #3
0
        public void LoadContent(ContentManager myContentManager, SpriteFont font)
        {
            image = myContentManager.Load<Texture2D>("figur");
            talkingimage = myContentManager.Load<Texture2D>("figurtalking");
            imageascii = new Sprite();
            imageascii.LoadContent(myContentManager, "at");
            animimage = new AnimatedSprite("hero", "figur", image, 4, 9);
            talkimage = new AnimatedSprite("herotalking", "figurtalking", talkingimage, 4, 5);

            playerRect.Width = (animimage.Texture.Width / animimage.Columns) / 2;
            playerRect.Height = (animimage.Texture.Height / animimage.Rows) / 5;

            verbmenu.LoadContent(myContentManager, font);
        }
예제 #4
0
 public void LoadContentTest_Spr()
 {
     Game1 game = new Game1();
     Sprite target = new Sprite();
     ContentManager theContentManager = game.Content;
     string theAssetName = "test";
     target.LoadContent(theContentManager, theAssetName);
     Assert.IsNotNull(target.getTex());
 }
예제 #5
0
        /// <summary>
        /// Add an image to the imagelist of the object.
        /// </summary>
        /// <param name="myContentManager">XNA Contentmanager</param>
        /// <param name="spritename">Name of the image file in the XNA Contentpipeline</param>
        public void AddSprite(ContentManager myContentManager, String spritename)
        {
            Sprite NewSprite = new Sprite();
            NewSprite.LoadContent(myContentManager, spritename);

            images.Add(NewSprite);
            imagenames.Add(spritename);
        }