📜 ⬆️ ⬇️

Problems with XNA 4 CTP


So, let's start with the fact that I wanted to write a continuation of my previous article on the development of games for Windows Phone 7 on XNA, but I did not succeed. Why? I'll tell you now.
Initial conditions: recently installed Windows 7 Professional + minimum of necessary software (browser, antivirus, ICQ). Well, plus Visual Studio 2010 Ultimate with Russian localization.

At first I attempted to install Windows Phone 7 Developer Tools , but the installation wizard pleased me with a uninformative window:



Reading the logs did not give any useful information, and I simply deleted all the software in any way associated with Silverlight:
')


Said and done, and after the manipulations, the tools were deigned to be installed and made available in Visual Studio:



The intended continuation of the article was supposed to tell about Cyrillic support, so I decided to first write about the fonts that game developers suggest Microsoft can use in their applications. The following fonts are included with the XNA Game Studio:

If you use them to display Latin characters, then everything is just a class - the fonts are beautiful and readable, but if we want to write something in Cyrillic with such fonts, the result is simply terrible. In the following screenshot, I compared the three fonts in the box and the standard Arial font:



Then I checked how XNA works with resources that have Cyrillic names in their names. Adding the file Lena.jpg to the resources and changing the code of the Draw method responsible for rendering, I launched the project for execution. As it turned out, everything works fine)



“Well, great!” - I thought and converted the project under Windows Phone 7.



But it was not there! Visual Studio refused to compile the resulting project, citing the lack of one at the beginning:



And then another manifest file:



The solution was to copy similar files from another project under Windows Phone 7. Note: in WindowsPhoneManifest.xml, in the field ProductID you need to substitute the GUID of your application from AssemblyInfo.cs:



However, after successful compilation and launch of the project, the emulator did not want to show anything except a black screen. I thought that the whole thing was in Lena and turned out to be right: after Lena’s commenting out, the emulator changed the black screen to blue:



“But where is the text?” You ask. And I will answer you - "I do not know." At first, I thought that the project had been incorrectly converted. To test this guess, I launched Microsoft Visual Studio 2010 Express for Windows Phone together with the tools and created a new game project for Windows Phone 7 there. Having added several lines of code responsible for outputting the “Test” line and the Arial font, I pressed Ctrl + F5 and got all the same lack of text:



Then I thought about the correctness of the installation of the tools and loaded the project from the previous article into the studio. Oddly enough, he also limited himself to showing a black screen:



I have several possible versions of this emulator behavior:

Fortunately, this is just a CTP, I am sure that the vast majority of bugs will be fixed by the release. Yes, and it should be noted that the configuration from the localized studio and the XNA SDK itself is non-standard, rarely anyone from game developers uses a localized environment. The article I wrote turned out a bit muddled, but in it I tried to describe as accurately as possible the problems you may encounter during the development of your projects.

And as always read:

PS Gentlemen minus! Please write a comment that you did not like in the article and how it can be improved.

Source: https://habr.com/ru/post/98364/


All Articles