Reputation: 11
I've used till last week VS 2008 so I'm not really used for VS 2010. I've loaded earlier a content(add reference) and I don't see it in the side of the toolbar(I mean the right side where all the references are just like VS 2008, and when I try to load that texture I added I'm getting an error "File not found", maybe I'm doing something wrong with loading the content? This is the code with the loading content:
player.Initialize(Content.Load<Texture2D>("ship_animated"), playerPosition);
Please, I really need help with this, thanks alot.
Upvotes: 0
Views: 247
Reputation: 20050
Content files (images, sounds, music, 3d models, etc) is not added "as a reference".
Adding a reference relates only to adding an Assembly reference to your project (code).
In order to add content, navigate to your Content Project, this is where all the actual content of your game is placed, right click on the project, and add items there.
A simpler way is to copy a file from Windows Explorer and paste it into the content project in visual studio.
What sort of project are you creating? For an XNA 4.0 game project, there will be a content project generated to go with it:
It is this project to which you should be adding the content items (images, etc).
What version of Visual Studio are you using ? I am using the Professional version.
Upvotes: 1