Show / Hide Table of Contents

Class MySprite

Inheritance
System.Object
MySprite
Namespace: VRage.Game.GUI.TextPanel
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
Type Description
TextAlignment

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

Type of the render layer

Declaration
public SpriteType Type
Field Value
Type Description
SpriteType

Methods

CreateClearClipRect()

Declaration
public static MySprite CreateClearClipRect()
Returns
Type Description
MySprite

CreateClipRect(Rectangle)

Declaration
public static MySprite CreateClipRect(Rectangle rect)
Parameters
Type Name Description
Rectangle rect
Returns
Type Description
MySprite

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
Type Description
MySprite

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
Type Description
MySprite

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
Type Name Description
MySprite other
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
Type Name Description
MySerializableSprite sprite
Returns
Type Description
MySprite

Implicit(MySprite to MySerializableSprite)

Declaration
public static implicit operator MySerializableSprite(MySprite sprite)
Parameters
Type Name Description
MySprite sprite
Returns
Type Description
MySerializableSprite
☀
☾
In This Article
Back to top
Generated by DocFX
☀
☾