Class SpriteRender
Sprite rendering object.
Namespace: FlaxEngine
Assembly: FlaxEngine.CSharp.dll
Syntax
[ActorContextMenu("New/UI/Sprite Render")]
[ActorToolbox("Visuals")]
[Unmanaged]
public class SpriteRender : Actor, ISerializable
Constructors
SpriteRender()
Properties
Color
Gets or sets the color of the sprite. Passed to the sprite material in parameter named Color
.
Declaration
[EditorOrder(10)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public Color Color { get; set; }
Property Value
Color
|
DrawModes
The draw passes to use for rendering this object. Uncheck Depth
to disable sprite casting shadows.
Declaration
[EditorOrder(50)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public DrawPass DrawModes { get; set; }
Property Value
DrawPass
|
FaceCamera
If checked, the sprite will automatically face the view camera, otherwise it will be oriented as an actor.
Declaration
[EditorOrder(40)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public bool FaceCamera { get; set; }
Property Value
System.Boolean
|
Image
The sprite texture to draw.
Declaration
[EditorOrder(20)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public Texture Image { get; set; }
Property Value
Texture
|
Material
The material used for the sprite rendering. It should contain texture parameter named Image and color parameter named Color. For showing sprites from sprite atlas ensure to add Vector4 param ImageMAD for UVs transformation.
Declaration
[EditorOrder(30)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public MaterialBase Material { get; set; }
Property Value
MaterialBase
|
Size
Gets or sets the size of the sprite.
Declaration
[EditorOrder(0)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public Float2 Size { get; set; }
Property Value
Float2
|
SortOrder
Gets the object sort order key used when sorting drawable objects during rendering. Use lower values to draw object before others, higher values are rendered later (on top). Can be used to control transparency drawing.
Declaration
[EditorOrder(60)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public sbyte SortOrder { get; set; }
Property Value
System.SByte
|
Sprite
Gets or sets the sprite to draw. Used only if Image is unset.
Declaration
[EditorOrder(25)]
[EditorDisplay("Sprite", null)]
[Unmanaged]
public SpriteHandle Sprite { get; set; }
Property Value
SpriteHandle
|