First of all, you can switch the language:

Project Settings

Choose the platform to create a game project, check the "Build", and then set "Project Directory" (must), there are two ways to set up:

1>Directly build content to the final game directory, here you can set the game program directory. This approach applies to Windows PC platforms, etc.

2>Build content to the project directory, need to set the game projects to cooperate to use. This approach applies to all platforms, and mobile platform such as Android must use this method:

a) Create a new game project : TestGame, set up "Project Directory" for the game project file directory, namely the TestGame.csproj directory.

b) Set up "Game Projject" for the game project file, namely TestGame.csproj.

c) Delete the Content folder in the TestGame project, all content management are done by the software.

d) In adding or deleting content, or change the content or directory name, click the menu "Edit - Update Project" (or the corresponding toolbar button) to update the TestGame project (need to set the ComboBox on the toolbar, choose a game platform). If you are using Visual Studio editors TestGame project, will pop up "detect file changes" dialog box, click "reload", synchronous content items (I'm sorry! This software is designed by MonoGame for Windows. But now I find that the project file of Android is different from the project file of Windows, this approach can not work well. ):

Content Management

Content management features are under the menu "Edit", including create, import, replace, delete, and build.

1>When import content, can select multiple local files, the unsupported file will be automatically ignore. Import content need to first select a directory or content, if you select a directory,the contents will be added to the directory; If you choose a content, the contents will be added to the directory with the content .

2>Replace can choose a local file, retained settings (name, compression and import, prosser), to replace the file is the same kind of content.

3>New root directory, it is to point to create a directory at the same level of the Content directory.

4>Build content need to choose a game platform (the ComboBox on the toolbar to set), and select a directory or content, if you select a directory and will build all the contents under the directory, if checked on the toolbar "Contains Children When Build" that will traverse the subdirectories in the directory. By default tag "Created" content will not be build, if for special reasons (such as the created. xnb file in explorer are deleted) need to build, can check the "Force Rebuild Content" on the toolbar.

5>Any contents will be monitored whether the file has been modified, if it's modified by other editing software, the software will mark it as "UnCreated". And can by double-clicking on the content (or through the menu "Edit - Edit") to open the system default editor for editing.

Custom Data

Xna/MonoGame provides serialization feature by Xml. Now defines a hero class as follows:

 1 namespace TestGame
 2 {
 3     [Serializable]
 4     public class HeroData
 5     {
 6         public string Name { get; set; }
 7         public int Health { get; set; }
 8         public float Speed { get; set; }
 9         public float Power { get; set; }
10         public float Magic { get; set; }
11         public List<WeaponData> Weapons { get; set; }
12         public List<SpriteData> Sprites { get; set; }
13     }
15     public class WeaponData
16     {
17         public string Name { get; set; }
18         public float Attack { get; set; }
19         public float Defense { get; set; }
20     }
22     public class SpriteData
23     {
24         public string Name { get; set; }
25         public float Speed { get; set; }
26         public float Magic { get; set; }
27     }
28 }


1>If you want to edit a custom class in this software, you must add "Serializable" attribute.

2>Do not use an array type property, you can use the List type to replace.

3>You must use the base type property, such as int, float, string, or enumeration, etc, and do not use a class type property.

After written, regenerate the TestGame project, copy the generated program to the program directory of this software, and then restart the software (When start this software will automatically search all the assemblies in the application directory). Through the menu "Edit - Create" (or the corresponding toolbar button) to create this type of data:

Then the edit dialog will pop up:

You can check the edited data by breakpoints :

Extend Content Pipeline

Put assembly to the software directory, the software will automatically look for the import, processing program (and custom types mentioned above).

Last edited Jun 23, 2013 at 11:20 AM by hobir, version 11


No comments yet.