Guest User

Untitled

a guest
Aug 9th, 2012
38
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /* Using Mercury Particle Engine, I'm trying to read my XML file and load the textures necessary to draw *particles on screen.
  2. *My problem is that if I just leave "Magical Trail" as it is, then I just drop it in the Content folder. I *can't organize my assets and out it in gfx/particles/ folder like everything else. MagicalTrail is actually *an XML file, but read as a texture.
  3. *Why can't I load the filepath, like I do for everything else?
  4. */
  5.  
  6.  
  7.   /// <summary>
  8.         /// Load graphics content for the game.
  9.         /// </summary>
  10.         public override void LoadContent()
  11.         {
  12.             if (contentManager == null)                 // Initializes ContentManager
  13.             {
  14.                 contentManager = new ContentManager(ScreenManager.Game.Services, "Content");
  15.             }
  16.  
  17.             arial = contentManager.Load<SpriteFont>(@"gfx/fonts/Arial");
  18.  
  19. // DOES NOT WORK       
  20.  
  21.             // Content for Mercury
  22.             myEffect = contentManager.Load(@"gfx/particles/MagicTrail");
  23.             myEffect.LoadContent(contentManager);
  24.             myEffect.Initialise();
  25.             myRenderer.LoadContent(contentManager);
  26.        
  27.  
  28. // WORKS       
  29.  
  30.             myEffect = contentManager.Load<Texture2D>("MagicTrail");
  31.             myEffect.LoadContent(contentManager);
  32.             myEffect.Initialise();
  33.             myRenderer.LoadContent(contentManager);
  34.         }
RAW Paste Data