Class MySprite
Inheritance
System.Object
MySprite
Assembly: VRage.Game.dll
Syntax
public sealed class MySprite : ValueType, IEquatable<MySprite>
Constructors
MySprite(SpriteType, String, Nullable<Vector2>, Nullable<Vector2>, Nullable<Color>, String, TextAlignment, Single)
Declaration
public MySprite(SpriteType type, string data = null, Nullable<Vector2> position = null, Nullable<Vector2> size = null, Nullable<Color> color = null, string fontId = null, TextAlignment alignment, float rotation = 0F)
Parameters
| Type |
Name |
Description |
| SpriteType |
type |
|
| System.String |
data |
|
| System.Nullable<Vector2> |
position |
|
| System.Nullable<Vector2> |
size |
|
| System.Nullable<Color> |
color |
|
| System.String |
fontId |
|
| TextAlignment |
alignment |
|
| System.Single |
rotation |
|
Fields
Alignment
Alignment for the text and sprites.
Declaration
public TextAlignment Alignment
Field Value
Color
Color mask to be used when rendering this layer. If not set, white will be used
Declaration
[Nullable]
public Nullable<Color> Color
Field Value
| Type |
Description |
| System.Nullable<Color> |
|
Data
Data to be rendered, depending on what the layer type is. This can be text or a texture path
Declaration
[Nullable]
public string Data
Field Value
| Type |
Description |
| System.String |
|
FontId
In case we are rendering text, what font to use.
Declaration
[Nullable]
public string FontId
Field Value
| Type |
Description |
| System.String |
|
Position
Render position for this layer. If not set, it will be placed in the center
Declaration
[Nullable]
public Nullable<Vector2> Position
Field Value
| Type |
Description |
| System.Nullable<Vector2> |
|
RotationOrScale
Rotation of sprite in radians. Used as scale for text.
Declaration
public float RotationOrScale
Field Value
| Type |
Description |
| System.Single |
|
Size
Render size for this layer. If not set, it will be sized to take up the whole texture
Declaration
[Nullable]
public Nullable<Vector2> Size
Field Value
| Type |
Description |
| System.Nullable<Vector2> |
|
Type
Declaration
Field Value
Methods
CreateClearClipRect()
Declaration
public static MySprite CreateClearClipRect()
Returns
CreateClipRect(Rectangle)
Declaration
public static MySprite CreateClipRect(Rectangle rect)
Parameters
Returns
CreateSprite(String, Vector2, Vector2)
Declaration
public static MySprite CreateSprite(string sprite, Vector2 position, Vector2 size)
Parameters
| Type |
Name |
Description |
| System.String |
sprite |
|
| Vector2 |
position |
|
| Vector2 |
size |
|
Returns
CreateText(String, String, Color, Single, TextAlignment)
Declaration
public static MySprite CreateText(string text, string fontId, Color color, float scale = 1F, TextAlignment alignment)
Parameters
| Type |
Name |
Description |
| System.String |
text |
|
| System.String |
fontId |
|
| Color |
color |
|
| System.Single |
scale |
|
| TextAlignment |
alignment |
|
Returns
Equals(Object)
Declaration
public override bool Equals(object obj)
Parameters
| Type |
Name |
Description |
| System.Object |
obj |
|
Returns
| Type |
Description |
| System.Boolean |
|
Equals(MySprite)
Declaration
public bool Equals(MySprite other)
Parameters
Returns
| Type |
Description |
| System.Boolean |
|
GetHashCode()
Declaration
public override int GetHashCode()
Returns
| Type |
Description |
| System.Int32 |
|
Operators
Implicit(MySerializableSprite to MySprite)
Declaration
public static implicit operator MySprite(MySerializableSprite sprite)
Parameters
Returns
Implicit(MySprite to MySerializableSprite)
Declaration
public static implicit operator MySerializableSprite(MySprite sprite)
Parameters
Returns