. I'm just getting started on an XNA game for Window Phone 7. Should my Entity class extend game component/drawable game component? Public class Game1 : Game { GraphicsDeviceManager _graphics; SpriteBatch _spriteBatch; public Game1() В XNA 4.0 и дополнении для Visual Studio 2010 существовал набор расширений которые Components. Microsoft XNA (англ. XNA's Not Acronymed) — набор инструментов с управляемой средой. XNA Game Studio 3.0 (для Visual Studio 2008 или бесплатной Visual C# 2008 Express. Base Class Library • Common Language Infrastructure •. Color System · Windows Image Acquisition · Windows Imaging Component.
When you create a new game project on XNA, VS automatically creates (among other things): a “Game1.cs” file, which contains a class “Game1”, subclass of XNA's class “Game”. In the dialog box, select “XNA Game Studio 3.1” and “Game Component”, and name it “Ball.cs”.. А, в книге Beggining XNA 2.0 Game Programming (Alexander Lobao) компонент и в главном окне все добавляется через Components. IO; namespace P10_1 { public class Game1 : Microsoft. Xna.Framework. Game { GraphicsDeviceManager graphics. Content; namespace P10_2 { /// <summary > /// This is a game component that implements IUpdateable. Xna.Framework. Game { SpriteFont FONT; public Texture2D texture; public. class DrawableGameComponent : GameComponent, IDrawable.
In XNA, should I use the built- in game component classes? I suppose it depends entirely on how you want to do things. I can say that most of the XNA tutorials and examples I've seen use them sparingly. Typically I see the built in Game.
Component/Drawable. Component types being used as the base class for services, and then those services call customized draw/update methods on the child- objects they manage. The main advantage you get from them is that if you add them to the Game. Components collection, the game will call their update, draw, and initialize methods during that phase of the game's cycle. You can get the same effect by just putting your own code into the Game's overrides for those methods and managing object collections yourself.