RenderTransform Structure |
Namespace: DigitalRune.Game.UI.Rendering
The RenderTransform type exposes the following members.
Name | Description | |
---|---|---|
RenderTransform(Vector2F, Vector2F, Single, Vector2F) |
Initializes a new instance of the RenderTransform struct.
| |
RenderTransform(Vector2F, Single, Single, Vector2F, Vector2F, Single, Vector2F) |
Initializes a new instance of the RenderTransform struct.
|
Name | Description | |
---|---|---|
Draw(SpriteBatch, Texture2D, Vector2F, Color) |
Transforms a sprite and adds it to a batch of sprites for rendering using the specified
texture, position and color.
| |
Draw(SpriteBatch, Texture2D, RectangleF, NullableRectangle, Color) |
Transforms a sprite and adds it to a batch of sprites for rendering using the specified
texture, position, source rectangle and color.
| |
Draw(SpriteBatch, Texture2D, Vector2F, NullableRectangle, Color) |
Transforms a sprite and adds it to a batch of sprites for rendering using the specified
texture, position, source rectangle and color.
| |
DrawString(SpriteBatch, SpriteFont, String, Vector2F, Color) |
Transforms a string and adds it to a batch of sprites for rendering using the specified
font, text, position, and color.
| |
DrawString(SpriteBatch, SpriteFont, StringBuilder, Vector2F, Color) |
Transforms a string and adds it to a batch of sprites for rendering using the specified
font, text, position, and color.
| |
Equals(Object) |
Indicates whether this instance and a specified object are equal.
(Overrides ValueTypeEquals(Object).) | |
Equals(RenderTransform) |
Indicates whether the current object is equal to another object of the same type.
| |
FromRenderDirection |
Transforms a direction by the inverse of this render transformation.
| |
FromRenderPosition |
Transforms a position by the inverse of this render transformation.
| |
GetHashCode |
Returns the hash code for this instance.
(Overrides ValueTypeGetHashCode.) | |
GetType | Gets the Type of the current instance. (Inherited from Object.) | |
Multiply |
Multiplies two render transformation.
| |
ToMatrix22F |
Converts this render transformation to a 2x2 matrix that only represents the scaling and the
rotation (no translation).
| |
ToMatrix33F |
Converts this render transformation to a 3x3 matrix.
| |
ToRenderDirection |
Transforms a direction.
| |
ToRenderPosition |
Transforms a position.
| |
ToString |
Returns the string representation of this render transform.
(Overrides ValueTypeToString.) | |
ToString(IFormatProvider) |
Returns the string representation of this pose using the specified culture-specific format
information.
| |
Transform |
Transforms the specified rectangle. (Does not work with rotations!)
|
Name | Description | |
---|---|---|
Equality |
Compares two RenderTransforms to determine whether they are the same.
| |
(RenderTransform to Matrix33F) |
Converts a render transformation to a 3x3 matrix.
| |
(RenderTransform to Matrix22F) |
Converts a render transformation to a 2x2 matrix that only represents the scaling and the
rotation (no translation).
| |
Inequality |
Compares two RenderTransforms to determine whether they are the different.
| |
Multiply |
Multiplies two render transformation.
|
Name | Description | |
---|---|---|
Identity |
The identity transform.
| |
Origin |
The origin of the render transformations in screen coordinates.
| |
Rotation |
The rotation given as the angle in radians.
| |
Scale |
The scale.
| |
Translation |
The translation.
|
The render transformation defines a 2D SRT transformation: Scaling followed by a rotation followed by a translation. The center of the scaling and rotation can be set explicitly.
Note that a render transformation cannot be inverted. The inverse is not an SRT transformation. But you can convert the render transformation to a 3x3 matrix.
Render transformations can be combined using multiplication. The order of the transformations is right-to-left - the same as when using matrices (Matrix22F, etc.).
SpriteBatch Rendering: The render transformation also provides wrapper methods for the Draw-routines of the SpriteBatch. The render transformation will be automatically applied to all sprites and strings that are drawn.
Important: The combination of rotations and non-uniform scaling can be problematic. Non-uniform scaling should only be used if the non-uniform scale is set by the last render transform in a hierarchy. (E.g. if an element in a visual tree has a rotation and the parent element has a non-uniform scaling, the child element won't be rendered correctly.)