Namespace MLEM.Data
Classes
- DataTextureAtlas
This class represents an atlas of TextureRegion objects which are loaded from a special texture atlas file. To load a data texture atlas, you can use LoadTextureAtlas(ContentManager, string, string, bool).
Data texture atlases are designed to be easy to write by hand. Because of this, their structure is very simple. Each texture region defined in the atlas consists of its names (where multiple names can be separated by whitespace), followed by a set of possible instructions and their arguments, also separated by whitespace. Any whitespace can be escaped by wrapping the region name or argument in single or double quotes.
- The
loc(orlocation) instruction defines the Area of the texture region as a rectangle whose origin is its top-left corner. It requires four arguments: x, y, width and height of the rectangle. - The (optional)
piv(orpivot) instruction defines the PivotPixels of the texture region. It requires two arguments: x and y. If it is not supplied, the pivot defaults to the top-left corner of the texture region. - The (optional)
off(ofoffset) instruction defines an offset that is added onto the location and pivot of this texture region. This is useful when duplicating a previously defined texture region to create a second region that has a constant offset. It requires two arguments: The x and y offset. - The (optional and repeatable)
cpy(orcopy) instruction defines an additional texture region that should also be generated from the same data, but with a given offset that will be applied to the location and pivot. It requires three arguments: the copy region's name and the x and y offsets. - The (optional and repeatable)
dat(ordata) instruction defines a custom data point that can be added to the resulting TextureRegion's GenericDataHolder data. It requires two arguments: the data point's name and the data point's value, the latter of which is also stored as a string value. - The (optional)
frm(orfrom) instruction defines a texture region (defined before the current region) whose data should be copied. All data from the region will be copied, but adding additional instructions afterwards modifies the data. It requires one argument: the name of the region whose data to copy. If this instruction is used, thelocinstruction is not required.
The following entry defines a texture region with the names LongTableRightandLongTableUp, whose Area will be a rectangle with X=32, Y=30, Width=64, Height=48, and whose PivotPixels will be a vector with X=80, Y=46.LongTableRight LongTableUp loc 32 30 64 48 piv 80 46- The
- DataTextureAtlasExtensions
A set of extension methods for dealing with DataTextureAtlas.
- RuntimeTexturePacker
A runtime texture packer provides the user with the ability to combine multiple Microsoft.Xna.Framework.Graphics.Texture2D instances into a single texture. Packing textures in this manner allows for faster rendering, as fewer texture swaps are required. The resulting texture segments are returned as TextureRegion instances.
- TypeHelper
This class contains a set of static helper methods for dealing with the string representations of Type names, including generic and non-generic types, and especially for converting between types and their AssemblyQualifiedName.