Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /* Using Mercury Particle Engine, I'm trying to read my XML file and load the textures necessary to draw *particles on screen.
- *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.
- *Why can't I load the filepath, like I do for everything else?
- */
- /// <summary>
- /// Load graphics content for the game.
- /// </summary>
- public override void LoadContent()
- {
- if (contentManager == null) // Initializes ContentManager
- {
- contentManager = new ContentManager(ScreenManager.Game.Services, "Content");
- }
- arial = contentManager.Load<SpriteFont>(@"gfx/fonts/Arial");
- // DOES NOT WORK
- // Content for Mercury
- myEffect = contentManager.Load(@"gfx/particles/MagicTrail");
- myEffect.LoadContent(contentManager);
- myEffect.Initialise();
- myRenderer.LoadContent(contentManager);
- // WORKS
- myEffect = contentManager.Load<Texture2D>("MagicTrail");
- myEffect.LoadContent(contentManager);
- myEffect.Initialise();
- myRenderer.LoadContent(contentManager);
- }
RAW Paste Data