reckfellENGINE

MeshTexture

Texture2D for drawing a mesh on Canvas, without its own image RID.

On this page
class MeshTextureReckfellSharpInherits Texture2D

MeshTexture passes a mesh and BaseTexture to canvas_item_add_mesh. It draws 2D geometry rather than baking a mesh into an image or rendering a camera view of a 3D model. Drawing requires both resources: a Mesh with suitable 2D vertices/UVs and BaseTexture. If either is missing, draw does nothing.

ImageSize is the logical geometry size used to scale DrawRect. It is not derived from BaseTexture and changes neither UVs nor mesh data. Although the C# API takes Vector2, native Size2i storage truncates fractional components. Supply positive nonzero integer dimensions: rectangle drawing divides destination size by ImageSize.

GetRid returns an empty RID: do not treat this object as a conventional GPU texture for a material or shader sampler. DrawRect ignores tile; DrawRectRegion ignores the source rectangle and clipUv and draws the entire mesh. HasAlpha always returns false and IsPixelOpaque always true: these are query stubs rather than transparency tests for BaseTexture or triangles. Use separate geometry/a mask for hit testing.

GetMesh and GetBaseTexture return shared resources rather than copies. Do not dispose returned aliases while an owner still uses them. Property and child-resource changes do not automatically emit Changed; notify your dependent system after a completed operation if needed. Dispose an owned MeshTexture after use.

The combined 23 Windows headless state checks establish references, values, integer size and absence of automatic Changed. Actual drawing, UVs, alpha blending and image quality were not tested; draw limitations were reviewed in source.

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

Constructors1

MeshTextureConstructor
# MeshTexture
C#
public MeshTexture();

Creates an owned Texture2D resource without Mesh/BaseTexture and with ImageSize=(0, 0). Configure geometry, base texture and positive logical size before drawing.

Properties3

BaseTextureProperty
# BaseTexture
C#
public Texture2D BaseTexture { get; set; }

Shared texture sampled by mesh UVs. Neither a source of automatic ImageSize nor a copy. null disables drawing; the setter neither emits Changed nor connects child-resource change forwarding.

ImageSizeProperty
# ImageSize
C#
public Vector2 ImageSize { get; set; }

Logical rectangle-drawing scale reference rather than BaseTexture dimensions. Stored internally as Size2i: fractional Vector2 components are truncated. Use positive nonzero integer dimensions; the setter neither validates them nor emits Changed.

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

Shared mesh with suitable 2D vertices and UVs for Canvas drawing. The setter stores the reference without validating geometry or emitting Changed. null disables drawing.

Methods6

GetBaseTextureTexture2D
# GetBaseTexture
C#
public Texture2D GetBaseTexture();

Returns BaseTexture. Shared texture sampled by mesh UVs. Neither a source of automatic ImageSize nor a copy. null disables drawing; the setter neither emits Changed nor connects child-resource change forwarding.

Returns Texture2D

Shared resource or null, not an independent copy.

GetImageSizeVector2
# GetImageSize
C#
public Vector2 GetImageSize();

Returns ImageSize. Logical rectangle-drawing scale reference rather than BaseTexture dimensions. Stored internally as Size2i: fractional Vector2 components are truncated. Use positive nonzero integer dimensions; the setter neither validates them nor emits Changed.

Returns Vector2

Logical integer dimensions represented as Vector2.

GetMeshMesh
# GetMesh
C#
public Mesh GetMesh();

Returns Mesh. Shared mesh with suitable 2D vertices and UVs for Canvas drawing. The setter stores the reference without validating geometry or emitting Changed. null disables drawing.

Returns Mesh

Shared resource or null, not an independent copy.

SetBaseTexturevoid
# SetBaseTexture
C#
public void SetBaseTexture(Texture2D texture);

Sets BaseTexture. Shared texture sampled by mesh UVs. Neither a source of automatic ImageSize nor a copy. null disables drawing; the setter neither emits Changed nor connects child-resource change forwarding.

Parameters
NameTypeDefault
textureTexture2D—
texture

Shared Texture2D sampled by mesh UVs, or null to disable draw.

SetImageSizevoid
# SetImageSize
C#
public void SetImageSize(Vector2 size);

Sets ImageSize. Logical rectangle-drawing scale reference rather than BaseTexture dimensions. Stored internally as Size2i: fractional Vector2 components are truncated. Use positive nonzero integer dimensions; the setter neither validates them nor emits Changed.

Parameters
NameTypeDefault
sizeVector2—
size

Positive nonzero logical size; fractional components are truncated.

SetMeshvoid
# SetMesh
C#
public void SetMesh(Mesh mesh);

Sets Mesh. Shared mesh with suitable 2D vertices and UVs for Canvas drawing. The setter stores the reference without validating geometry or emitting Changed. null disables drawing.

Parameters
NameTypeDefault
meshMesh—
mesh

Mesh with 2D vertices/UVs or null to disable draw; the setter does not validate geometry.

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.