reckfellENGINE

MeshInstance2D

Entity used for displaying a Mesh in 2D.

On this page
class MeshInstance2DReckfellSharpInherits Entity2D

Entity used for displaying a Mesh in 2D.

Entity used for displaying a Mesh in 2D. This can be faster to render compared to displaying a Sprite2D node with large transparent areas, especially if the node takes up a lot of space on screen at high viewport resolutions. This is because using a mesh designed to fit the sprite's opaque areas will reduce GPU fill rate utilization (at the cost of increased vertex processing utilization). When a Mesh has to be instantiated more than thousands of times close to each other, consider using a MultiMesh in a MultiMeshInstance2D instead. A MeshInstance2D can be created from an existing Sprite2D via a tool in the editor toolbar. Select the Sprite2D node, then choose Sprite2D > Convert to MeshInstance2D at the top of the 2D editor viewport.

Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.

Constructors1

MeshInstance2DConstructor
# MeshInstance2D
C#
public MeshInstance2D();

Properties2

MeshProperty
# Mesh
C#
public Mesh Mesh { get; set; }

The Mesh that will be drawn by the MeshInstance2D.

TextureProperty
# Texture
C#
public Texture2D Texture { get; set; }

The Texture2D that will be used if using the default CanvasItemMaterial. Can be accessed as TEXTURE in CanvasItem shader.

Methods4

GetMeshMesh
# GetMesh
C#
public Mesh GetMesh();
Returns Mesh
GetTextureTexture2D
# GetTexture
C#
public Texture2D GetTexture();
Returns Texture2D
SetMeshvoid
# SetMesh
C#
public void SetMesh(Mesh mesh);
Parameters
NameTypeDefault
meshMesh—
SetTexturevoid
# SetTexture
C#
public void SetTexture(Texture2D texture);
Parameters
NameTypeDefault
textureTexture2D—

Signals and events1

TextureChangedEvent
# TextureChanged
C#
public event Action TextureChanged;

Emitted when the MeshInstance2D.Texture is changed.

Reckfell Engine documentationBack to top ↑
QUICK LINKSGetting startedEntity hierarchyC# & .NET 10Scenes and prefabs
Reckfell guides and full API K
reckfellENGINE
RECKFELL ACCOUNT

Sign in

Sign in to your Reckfell account.

One account for the entire Reckfell platform.