PlaceholderTexture2D
A size-preserving Texture2D placeholder without its source image.
PlaceholderTexture2D retains dimensions when source pixels are absent or unnecessary. Defaults are 1×1, HasAlpha=false and GetImage() returning null. It is neither a loader nor an automatically loading asset or source-image copy.
Size is Vector2, but reads use integer Width/Height. Assigning (12.75,8.5), for example, reads back as (12,8). Use positive integer dimensions. The setter emits Changed even for repeated values; metadata edits neither create an Image nor replace an existing placeholder RID. Do not free the RID separately from its owning resource.
Dimensions, notifications, absent Image and RID stability were checked on current Windows/Vulkan. Drawn appearance, shader sampling and visual quality were not tested.
Declarations checked against C# SDK 1.0.0. Expand a name to see declarations and documentation.
Constructors1
PlaceholderTexture2DConstructor
public PlaceholderTexture2D();Creates a metadata-sized 1×1 placeholder without a source Image. HasAlpha returns false. A GPU placeholder RID is created on GetRid access.
Properties1
SizeProperty
public Vector2 Size { get; set; }Metadata size, initially (1,1). Despite Vector2 typing, Width/Height and Size readback use integer dimensions: fractional components are truncated. The setter uploads no pixels, preserves the placeholder RID and emits Changed even for repeated values. Use positive integer dimensions.
Methods1
SetSizevoid
public void SetSize(Vector2 size);Metadata size, initially (1,1). Despite Vector2 typing, Width/Height and Size readback use integer dimensions: fractional components are truncated. The setter uploads no pixels, preserves the placeholder RID and emits Changed even for repeated values. Use positive integer dimensions.
| Name | Type | Default |
|---|---|---|
size | Vector2 | — |
sizeMetadata size, initially (1,1). Despite Vector2 typing, Width/Height and Size readback use integer dimensions: fractional components are truncated. The setter uploads no pixels, preserves the placeholder RID and emits Changed even for repeated values. Use positive integer dimensions.