0
\$\begingroup\$

So i want to figure out a way to use the ContentManager.Load method with full directory paths, so lets say

Content.Load<T>(@"Images\SomeImage");

becomes

Content.Load<T>(@"C:\Users\UserName\Documents\Visual Studio 2013\Projects\MyProject\Content\SomeImage");

Thanks in advance.

\$\endgroup\$
4
  • \$\begingroup\$ The resources are packaged with your game and you have no control over where its installed if you distribute it. I don't see a practical application for doing this. \$\endgroup\$ Commented Nov 24, 2014 at 0:21
  • \$\begingroup\$ Why do you want to do this? It seems extremely limiting and pointless. \$\endgroup\$
    – user1430
    Commented Nov 24, 2014 at 1:49
  • \$\begingroup\$ Given the map-editor tag, and his previous question, I think he wants to load a precompiled asset from outside of the application/games content directory. \$\endgroup\$
    – Seta
    Commented Nov 24, 2014 at 3:14
  • \$\begingroup\$ Fair enough, seems you would just want to load them in with Texture2D.FromStream in that case though. Additionally since you would probably want to package the images with the map coping the images to the content directory to group them with the associated map. \$\endgroup\$ Commented Nov 24, 2014 at 15:19

1 Answer 1

1
\$\begingroup\$

Set Game.Content.RootDirectory to the path you want and then just specify the file name portion. But keep in mind that you still have to include them in the Content project.

If you don't want to/can't do that, then forgo the ContentPipeline altogether.

\$\endgroup\$

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .