What exactly does this do?
Content.RootDirectory = "Content";
And how does it relate to:
player.Initialize(Content.Load<Texture2D>("player"), playerPosition);
Thanks.
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
“Content” is the folder/directory where image and model assets are physically stored. There should be a directory in your solution automatically created with a new XNA solution.
Here, a player (custom class I assume) is being initialized with an asset name (“player”) to display, and it’s position in 2D/3D space.
In essence, the first code is telling the compiler where all the content lives, whereas the second piece of code is loading the asset for the player class.