reckfellENGINE

AtlasTexture

Region of a shared atlas for 2D drawing without copying source pixels.

On this page
class AtlasTextureReckfellSharpInherits Texture2D

AtlasTexture selects a Region from a shared Atlas and adds a logical Margin. Use multiple resources for elements of one sprite sheet; the source image stays shared. To create a separate pixel texture, obtain a GetImage crop and create an ImageTexture if source data is available. AtlasTexture itself does not allocate a GPU copy of the region.

Region uses texture coordinates. Margin.Position offsets content, Margin.Size adds logical dimensions, and GetImage excludes those margins. Zero Region axes use the corresponding source dimensions. Use integer boundaries inside the atlas for precise slicing.

Region repetition is not equivalent to an independent tiling texture: current DrawRect tile does not create a repeated crop. Use an appropriate source or separate image for tiling. FilterClip restricts drawing samples without repairing source mipmaps. Do not rely on 2D crop commands in 3D: the RID refers to the shared source.

Crop pixels, dimensions, margins, nesting, draw-argument forwarding and persistence were checked in Windows Forward+/Vulkan. Visible seams, packing performance, 3D materials and all repeat variants did not receive visual acceptance in this run.

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

Constructors1

AtlasTextureConstructor
# AtlasTexture
C#
public AtlasTexture();

Creates AtlasTexture without a source: Atlas = null, zero Region and Margin, FilterClip = false. Without a source the placeholder size is 1×1 and GetImage returns null. Assign Atlas before using pixel data.

Properties4

AtlasProperty
# Atlas
C#
public Texture2D Atlas { get; set; }

Shared source Texture2D; null by default. Assignment neither copies pixels nor creates a separate GPU texture for the crop. GetRid returns the source RID. Nested AtlasTexture resources are supported, but do not create self-references or cycles. Multiple regions can share one source.

FilterClipProperty
# FilterClip
C#
public bool FilterClip { get; set; }

Defaults to false. Passes region sampling clipping during 2D drawing to help separate neighboring atlas elements under filtering. It does not edit pixels or generate mipmap padding. Current AtlasTexture uses this property even in DrawRectRegion, independently of its clipUV argument. Visual edge quality was not checked in this run.

MarginProperty
# Margin
C#
public Rect2 Margin { get; set; }

Additional logical margin, defaulting to a zero Rect2. Position offsets drawn content; Size adds total canvas dimensions on nonzero Region axes. These are not four independent side widths. For example, a 4×4 Region with Margin.Size 3×4 has logical size 7×8. GetImage returns the crop without these margins. Margin neither edits source pixels nor generates mipmap padding.

RegionProperty
# Region
C#
public Rect2 Region { get; set; }

Region in source texture coordinates, not 0…1 UVs. Defaults to a zero-sized Rect2: that axis uses the source size. A nonzero axis has logical size floor(Region.Size) plus Margin.Size; a zero axis uses source size without adding Margin.Size. The property retains fractional input, but internal region dimensions are floored. Use integer boundaries inside the source for predictable slicing.

Methods8

GetAtlasTexture2D
# GetAtlas
C#
public Texture2D GetAtlas();

Returns AtlasTexture.Atlas.

Returns Texture2D

Current Atlas value. The texture reference is shared rather than copied; it can be null.

GetMarginRect2
# GetMargin
C#
public Rect2 GetMargin();

Returns AtlasTexture.Margin.

Returns Rect2

Current Margin value.

GetRegionRect2
# GetRegion
C#
public Rect2 GetRegion();

Returns AtlasTexture.Region.

Returns Rect2

Current Region value.

HasFilterClipbool
# HasFilterClip
C#
public bool HasFilterClip();

Returns AtlasTexture.FilterClip.

Returns bool

Current FilterClip value.

SetAtlasvoid
# SetAtlas
C#
public void SetAtlas(Texture2D atlas);

Sets AtlasTexture.Atlas.

Parameters
NameTypeDefault
atlasTexture2D—
atlas

Shared Texture2D or null; do not create self-references or cycles.

SetFilterClipvoid
# SetFilterClip
C#
public void SetFilterClip(bool enable);

Sets AtlasTexture.FilterClip.

Parameters
NameTypeDefault
enablebool—
enable

Restrict sampling to the atlas region during 2D drawing.

SetMarginvoid
# SetMargin
C#
public void SetMargin(Rect2 margin);

Sets AtlasTexture.Margin.

Parameters
NameTypeDefault
marginRect2—
margin

Position offsets content; Size adds logical canvas dimensions without changing pixels.

SetRegionvoid
# SetRegion
C#
public void SetRegion(Rect2 region);

Sets AtlasTexture.Region.

Parameters
NameTypeDefault
regionRect2—
region

Source region in texture coordinates; a zero axis uses source size.

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.