How do you display a PNG image in WP7 starting in coordinate (X,Y), and using XNA
Share
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.
Add the image to the XNA content project (drag drop the file).
In the game class add a variable that holds the texture reference:
In the LoadContent() method load the texture:
texturename has to be the texture’s asset name. By default this is the filename without extension.
In the Draw() method draw the texture at a given position x, y:
This is one of the most basic tasks in XNA. Before asking somebody, you should try to find the solution on your own. It would have taken about half a minute to find the answer on the internet.