SpriteBase3D
2D sprite node in 3D environment.
2D sprite node in 3D environment.
A node that displays 2D texture information in a 3D environment. See also Sprite3D where many other properties are defined.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Properties20
AlphaAntialiasingEdgeProperty
public float AlphaAntialiasingEdge { get; set; }Threshold at which antialiasing will be applied on the alpha channel.
AlphaAntialiasingModeProperty
public BaseMaterial3D.AlphaAntiAliasing AlphaAntialiasingMode { get; set; }The type of alpha antialiasing to apply.
AlphaCutProperty
public SpriteBase3D.AlphaCutMode AlphaCut { get; set; }The alpha cutting mode to use for the sprite.
AlphaHashScaleProperty
public float AlphaHashScale { get; set; }The hashing scale for Alpha Hash. Recommended values between 0 and 2.
AlphaScissorThresholdProperty
public float AlphaScissorThreshold { get; set; }Threshold at which the alpha scissor will discard values.
AxisProperty
public Vector3.Axis Axis { get; set; }The direction in which the front of the texture faces.
BillboardProperty
public BaseMaterial3D.BillboardModeEnum Billboard { get; set; }Selects the sprite billboard mode. When billboard geometry also casts shadows, camera-facing orientation affects the shadow pass. With multiple cameras, check which camera orientation is used before relying on the shadow shape.
CenteredProperty
public bool Centered { get; set; }If true, texture will be centered.
DoubleSidedProperty
public bool DoubleSided { get; set; }If true, texture can be seen from the back as well, if false, it is invisible when looking at it from behind.
FixedSizeProperty
public bool FixedSize { get; set; }If true, the texture is rendered at the same size regardless of distance. The texture's size on screen is the same as if the camera was 1.0 units away from the texture's origin, regardless of the actual distance from the camera. The Camera3D's field of view (or Camera3D.Size when in orthogonal/frustum mode) still affects the size the sprite is drawn at.
FlipHProperty
public bool FlipH { get; set; }If true, texture is flipped horizontally.
FlipVProperty
public bool FlipV { get; set; }If true, texture is flipped vertically.
ModulateProperty
public Color Modulate { get; set; }A color value used to multiply the texture's colors. Can be used for mood-coloring or to simulate the color of ambient light.
Note: Unlike CanvasItem.Modulate for 2D, colors with values above 1.0 (overbright) are not supported.
Note: If a GeometryInstance3D.MaterialOverride is defined on the SpriteBase3D, the material override must be configured to take vertex colors into account for albedo. Otherwise, the color defined in SpriteBase3D.Modulate will be ignored. For a BaseMaterial3D, BaseMaterial3D.VertexColorUseAsAlbedo must be true. For a ShaderMaterial, ALBEDO *= COLOR.rgb; must be inserted in the shader's fragment() function.
NoDepthTestProperty
public bool NoDepthTest { get; set; }If true, depth testing is disabled and the object will be drawn in render order.
OffsetProperty
public Vector2 Offset { get; set; }The texture's drawing offset.
Note: When you increase SpriteBase3D.Offset.y in Sprite3D, the sprite moves upward in world space (i.e., +Y is up).
PixelSizeProperty
public float PixelSize { get; set; }The size of one pixel's width on the sprite to scale it in 3D.
RenderPriorityProperty
public int RenderPriority { get; set; }Sets the render priority for the sprite. Higher priority objects will be sorted in front of lower priority objects.
Note: This only applies if SpriteBase3D.AlphaCut is set to SpriteBase3D.AlphaCutMode.Disabled (default value).
Note: This only applies to sorting of transparent objects. This will not impact how transparent objects are sorted relative to opaque objects. This is because opaque objects are not sorted, while transparent objects are sorted from back to front (subject to priority).
ShadedProperty
public bool Shaded { get; set; }If true, the Light3D in the Environment has effects on the sprite.
TextureFilterProperty
public BaseMaterial3D.TextureFilterEnum TextureFilter { get; set; }Filter flags for the texture. Note: Linear filtering may cause artifacts around the edges, which are especially noticeable on opaque textures. To prevent this, use textures with transparent or identical colors around the edges.
TransparentProperty
public bool Transparent { get; set; }If true, the texture's transparency and the opacity are used to make those parts of the sprite invisible.
Methods34
GenerateTriangleMeshTriangleMesh
public TriangleMesh GenerateTriangleMesh();Returns a TriangleMesh with the sprite's vertices following its current configuration (such as its SpriteBase3D.Axis and SpriteBase3D.PixelSize).
TriangleMeshGetAlphaAntialiasingBaseMaterial3D.AlphaAntiAliasing
public BaseMaterial3D.AlphaAntiAliasing GetAlphaAntialiasing();BaseMaterial3D.AlphaAntiAliasingGetAlphaAntialiasingEdgefloat
public float GetAlphaAntialiasingEdge();floatGetAlphaCutModeSpriteBase3D.AlphaCutMode
public SpriteBase3D.AlphaCutMode GetAlphaCutMode();SpriteBase3D.AlphaCutModeGetAlphaHashScalefloat
public float GetAlphaHashScale();floatGetAlphaScissorThresholdfloat
public float GetAlphaScissorThreshold();floatGetAxisVector3.Axis
public Vector3.Axis GetAxis();Vector3.AxisGetBillboardModeBaseMaterial3D.BillboardModeEnum
public BaseMaterial3D.BillboardModeEnum GetBillboardMode();BaseMaterial3D.BillboardModeEnumGetDrawFlagbool
public bool GetDrawFlag(SpriteBase3D.DrawFlags flag);Returns the value of the specified flag.
| Name | Type | Default |
|---|---|---|
flag | SpriteBase3D.DrawFlags | — |
boolGetItemRectRect2
public Rect2 GetItemRect();Returns the rectangle representing this sprite.
Rect2GetModulateColor
public Color GetModulate();ColorGetOffsetVector2
public Vector2 GetOffset();Vector2GetPixelSizefloat
public float GetPixelSize();floatGetRenderPriorityint
public int GetRenderPriority();intGetTextureFilterBaseMaterial3D.TextureFilterEnum
public BaseMaterial3D.TextureFilterEnum GetTextureFilter();BaseMaterial3D.TextureFilterEnumIsCenteredbool
public bool IsCentered();boolIsFlippedHbool
public bool IsFlippedH();boolIsFlippedVbool
public bool IsFlippedV();boolSetAlphaAntialiasingvoid
public void SetAlphaAntialiasing(BaseMaterial3D.AlphaAntiAliasing alphaAA);| Name | Type | Default |
|---|---|---|
alphaAA | BaseMaterial3D.AlphaAntiAliasing | — |
SetAlphaAntialiasingEdgevoid
public void SetAlphaAntialiasingEdge(float edge);| Name | Type | Default |
|---|---|---|
edge | float | — |
SetAlphaCutModevoid
public void SetAlphaCutMode(SpriteBase3D.AlphaCutMode mode);| Name | Type | Default |
|---|---|---|
mode | SpriteBase3D.AlphaCutMode | — |
SetAlphaHashScalevoid
public void SetAlphaHashScale(float threshold);| Name | Type | Default |
|---|---|---|
threshold | float | — |
SetAlphaScissorThresholdvoid
public void SetAlphaScissorThreshold(float threshold);| Name | Type | Default |
|---|---|---|
threshold | float | — |
SetAxisvoid
public void SetAxis(Vector3.Axis axis);| Name | Type | Default |
|---|---|---|
axis | Vector3.Axis | — |
SetBillboardModevoid
public void SetBillboardMode(BaseMaterial3D.BillboardModeEnum mode);| Name | Type | Default |
|---|---|---|
mode | BaseMaterial3D.BillboardModeEnum | — |
SetCenteredvoid
public void SetCentered(bool centered);| Name | Type | Default |
|---|---|---|
centered | bool | — |
SetDrawFlagvoid
public void SetDrawFlag(SpriteBase3D.DrawFlags flag, bool enabled);If true, the specified flag will be enabled.
| Name | Type | Default |
|---|---|---|
flag | SpriteBase3D.DrawFlags | — |
enabled | bool | — |
SetFlipHvoid
public void SetFlipH(bool flipH);| Name | Type | Default |
|---|---|---|
flipH | bool | — |
SetFlipVvoid
public void SetFlipV(bool flipV);| Name | Type | Default |
|---|---|---|
flipV | bool | — |
SetModulatevoid
public void SetModulate(Color modulate);| Name | Type | Default |
|---|---|---|
modulate | Color | — |
SetOffsetvoid
public void SetOffset(Vector2 offset);| Name | Type | Default |
|---|---|---|
offset | Vector2 | — |
SetPixelSizevoid
public void SetPixelSize(float pixelSize);| Name | Type | Default |
|---|---|---|
pixelSize | float | — |
SetRenderPriorityvoid
public void SetRenderPriority(int priority);| Name | Type | Default |
|---|---|---|
priority | int | — |
SetTextureFiltervoid
public void SetTextureFilter(BaseMaterial3D.TextureFilterEnum mode);| Name | Type | Default |
|---|---|---|
mode | BaseMaterial3D.TextureFilterEnum | — |
SpriteBase3D.AlphaCutMode
| Value | Description |
|---|---|
Disabled = 0 | This mode performs standard alpha blending. It can display translucent areas, but transparency sorting issues may be visible when multiple transparent materials are overlapping. |
Discard = 1 | This mode only allows fully transparent or fully opaque pixels. Harsh edges will be visible unless some form of screen-space antialiasing is enabled (see |
Hash = 3 | This mode draws cuts off all values below a spatially-deterministic threshold, the rest will remain opaque. |
OpaquePrepass = 2 | This mode draws fully opaque pixels in the depth prepass. This is slower than |
SpriteBase3D.DrawFlags
| Value | Description |
|---|---|
DisableDepthTest = 3 | Disables the depth test, so this object is drawn on top of all others. However, objects drawn after it in the draw order may cover it. |
DoubleSided = 2 | If set, texture can be seen from the back as well. If not, the texture is invisible when looking at it from behind. |
FixedSize = 4 | Label is scaled by depth so that it always appears the same size on screen. |
Max = 5 | Represents the size of the |
Shaded = 1 | If set, lights in the environment affect the sprite. |
Transparent = 0 | If set, the texture's transparency and the opacity are used to make those parts of the sprite invisible. |