Tag Info

Hot answers tagged


Yes, you can add (Drawable)GameComponents at any time. When you add them before Game.Initialize (eg: in your game constructor), they will have their Initialize method called when Game.Initialize is called. If you add them after Initialize is called on your game class, then they will have their Initialize method called when they are added to the ...


It seems I have managed to resolve the issue by using the overloaded Texture2D.GetData (int level, Rectangle? rect, T[] data, int startIndex, int elementCount) method. Texture2D texture = level.Tiles[x, y].Texture; Rectangle source = level.Tiles[x, y].Source; Color[] colorData = new Color[source.Width * source.Height]; texture.GetData(0, source, colorData, ...


Just build the XNB file on your personal machine, and use that file in your project. Remove the .spritefont file from your content project. Then add the built XNB file to your game project, in an appropriate directory (generally "Content") and set its properties (select it and press F4) to "Copy if newer". This is off the top of my head. So look at the ...


The easier is to test it... :) but yes... you can... the texture maximum size is 2048x2048 or 4096x4096 depends on the profile, you can use a array in CPU memory to fill it, Color[] colors = new Color[2048x2048] Texture.SetData(colors); and save to png method is no related to viewport.

Only top voted, non community-wiki answers of a minimum length are eligible