reckfellENGINE

TextureButton

Button with state textures and an optional click mask.

On this page
class TextureButtonReckfellSharpInherits BaseButton

TextureButton inherits Press, Pressed, ToggleMode and ButtonGroup from BaseButton, but draws assigned textures rather than ordinary Button theme visuals. Set TextureNormal and optionally TexturePressed, TextureHover, TextureDisabled and TextureFocused. Prefer matching dimensions and alignment across states, especially with a click mask.

StretchMode defaults to Keep: the texture draws at source size. Changing Size alone does not stretch it. For a scalable button, set IgnoreTextureSize = true and choose StretchMode: Scale stretches each axis, KeepAspectCentered fits and centers, KeepAspectCovered fills with a central crop. IgnoreTextureSize removes intrinsic minimum size while retaining CustomMinimumSize and parent constraints.

With IgnoreTextureSize = false, minimum size comes from the first available source: TextureNormal, otherwise TexturePressed, otherwise TextureHover, otherwise TextureClickMask. It is not the maximum of all state sizes. TextureDisabled and TextureFocused do not supply minimum size. If only a focus texture is used, size the control explicitly.

Pressed appearance falls back from missing TexturePressed to Hover, then Normal. Disabled without its own texture uses Normal. TextureFocused draws over the current state when focused; it is a separate overlay rather than a universal replacement for the normal texture. A missing texture can leave a state without drawing while BaseButton behavior remains active.

TextureClickMask is a separate Bitmap: true accepts hits and false excludes them. TextureNormal transparency does not automatically create a mask. Scaling and cropping use geometry calculated during drawing. Current mask hit testing does not apply FlipH/FlipV: supply a separately mirrored mask for asymmetric shapes or avoid flipping the image.

Textures and Bitmap are shared resources. Texture changes are observed; edits to an assigned Bitmap do not have the same automatic sizing connection. After changing mask dimensions, explicitly call UpdateMinimumSize and QueueRedraw or assign a new resource. Use a separate child element for text; TextureButton does not provide Text.

BaseButton.

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

Constructors1

TextureButtonConstructor
# TextureButton
C#
public TextureButton();

Creates a button without textures or a mask: StretchMode = Keep, IgnoreTextureSize = false, flips off. Activation follows BaseButton.

Properties10

FlipHProperty
# FlipH
C#
public bool FlipH { get; set; }

Mirror texture drawing horizontally, default false. Does not edit the resource; current TextureClickMask testing does not apply this flip.

FlipVProperty
# FlipV
C#
public bool FlipV { get; set; }

Mirror texture drawing vertically, default false. Does not edit the resource; asymmetric click masks require a separately matching shape.

IgnoreTextureSizeProperty
# IgnoreTextureSize
C#
public bool IgnoreTextureSize { get; set; }

Ignore the main texture/mask-derived minimum, default false. Does not select scaling behavior or remove CustomMinimumSize.

StretchModeProperty
# StretchMode
C#
public TextureButton.StretchModeEnum StretchMode { get; set; }

Drawing mode, default Keep. Scale stretches, Tile repeats, Keep/KeepCentered retain source size, KeepAspect variants retain proportions. Separately enable IgnoreTextureSize to shrink below intrinsic minimum.

TextureClickMaskProperty
# TextureClickMask
C#
public Bitmap TextureClickMask { get; set; }

Shared hit Bitmap rather than Texture2D. true accepts a point and false excludes it; image alpha is not automatically used. Current hit testing does not mirror the mask for FlipH/FlipV. Resizing it requires explicit minimum/redraw refresh.

TextureDisabledProperty
# TextureDisabled
C#
public Texture2D TextureDisabled { get; set; }

Shared disabled-state Texture2D, or null. Falls back to Normal. Does not supply Control minimum or enable Disabled itself.

TextureFocusedProperty
# TextureFocused
C#
public Texture2D TextureFocused { get; set; }

Shared focus-overlay Texture2D, or null. Draws over the state; can be the sole image when others are absent. Does not supply Control minimum.

TextureHoverProperty
# TextureHover
C#
public Texture2D TextureHover { get; set; }

Shared hover Texture2D, or null. Supplies minimum only without Normal and Pressed; absent hover can use Normal or a selected Pressed state.

TextureNormalProperty
# TextureNormal
C#
public Texture2D TextureNormal { get; set; }

Base shared Texture2D, or null. First priority for minimum size even when other states are larger.

TexturePressedProperty
# TexturePressed
C#
public Texture2D TexturePressed { get; set; }

Shared pressed-state Texture2D, or null. Falls back to Hover then Normal. Second minimum-size priority after Normal.

Methods20

GetClickMaskBitmap
# GetClickMask
C#
public Bitmap GetClickMask();

Shared hit Bitmap rather than Texture2D. true accepts a point and false excludes it; image alpha is not automatically used. Current hit testing does not mirror the mask for FlipH/FlipV. Resizing it requires explicit minimum/redraw refresh.

Returns Bitmap

Shared Bitmap, or null.

GetIgnoreTextureSizebool
# GetIgnoreTextureSize
C#
public bool GetIgnoreTextureSize();

Ignore the main texture/mask-derived minimum, default false. Does not select scaling behavior or remove CustomMinimumSize.

Returns bool

true when intrinsic texture minimum is ignored.

GetStretchModeTextureButton.StretchModeEnum
# GetStretchMode
C#
public TextureButton.StretchModeEnum GetStretchMode();

Drawing mode, default Keep. Scale stretches, Tile repeats, Keep/KeepCentered retain source size, KeepAspect variants retain proportions. Separately enable IgnoreTextureSize to shrink below intrinsic minimum.

Returns TextureButton.StretchModeEnum

Selected TextureButton.StretchModeEnum.

GetTextureDisabledTexture2D
# GetTextureDisabled
C#
public Texture2D GetTextureDisabled();

Shared disabled-state Texture2D, or null. Falls back to Normal. Does not supply Control minimum or enable Disabled itself.

Returns Texture2D

Explicit shared Texture2D for this state, or null; not the selected fallback.

GetTextureFocusedTexture2D
# GetTextureFocused
C#
public Texture2D GetTextureFocused();

Shared focus-overlay Texture2D, or null. Draws over the state; can be the sole image when others are absent. Does not supply Control minimum.

Returns Texture2D

Explicit shared Texture2D for this state, or null; not the selected fallback.

GetTextureHoverTexture2D
# GetTextureHover
C#
public Texture2D GetTextureHover();

Shared hover Texture2D, or null. Supplies minimum only without Normal and Pressed; absent hover can use Normal or a selected Pressed state.

Returns Texture2D

Explicit shared Texture2D for this state, or null; not the selected fallback.

GetTextureNormalTexture2D
# GetTextureNormal
C#
public Texture2D GetTextureNormal();

Base shared Texture2D, or null. First priority for minimum size even when other states are larger.

Returns Texture2D

Explicit shared Texture2D for this state, or null; not the selected fallback.

GetTexturePressedTexture2D
# GetTexturePressed
C#
public Texture2D GetTexturePressed();

Shared pressed-state Texture2D, or null. Falls back to Hover then Normal. Second minimum-size priority after Normal.

Returns Texture2D

Explicit shared Texture2D for this state, or null; not the selected fallback.

IsFlippedHbool
# IsFlippedH
C#
public bool IsFlippedH();

Mirror texture drawing horizontally, default false. Does not edit the resource; current TextureClickMask testing does not apply this flip.

Returns bool

true for horizontal drawing flip.

IsFlippedVbool
# IsFlippedV
C#
public bool IsFlippedV();

Mirror texture drawing vertically, default false. Does not edit the resource; asymmetric click masks require a separately matching shape.

Returns bool

true for vertical drawing flip.

SetClickMaskvoid
# SetClickMask
C#
public void SetClickMask(Bitmap mask);

Shared hit Bitmap rather than Texture2D. true accepts a point and false excludes it; image alpha is not automatically used. Current hit testing does not mirror the mask for FlipH/FlipV. Resizing it requires explicit minimum/redraw refresh.

Parameters
NameTypeDefault
maskBitmap—
mask

Shared hit Bitmap rather than Texture2D. true accepts a point and false excludes it; image alpha is not automatically used. Current hit testing does not mirror the mask for FlipH/FlipV. Resizing it requires explicit minimum/redraw refresh.

SetFlipHvoid
# SetFlipH
C#
public void SetFlipH(bool enable);

Mirror texture drawing horizontally, default false. Does not edit the resource; current TextureClickMask testing does not apply this flip.

Parameters
NameTypeDefault
enablebool—
enable

Mirror texture drawing horizontally, default false. Does not edit the resource; current TextureClickMask testing does not apply this flip.

SetFlipVvoid
# SetFlipV
C#
public void SetFlipV(bool enable);

Mirror texture drawing vertically, default false. Does not edit the resource; asymmetric click masks require a separately matching shape.

Parameters
NameTypeDefault
enablebool—
enable

Mirror texture drawing vertically, default false. Does not edit the resource; asymmetric click masks require a separately matching shape.

SetIgnoreTextureSizevoid
# SetIgnoreTextureSize
C#
public void SetIgnoreTextureSize(bool ignore);

Ignore the main texture/mask-derived minimum, default false. Does not select scaling behavior or remove CustomMinimumSize.

Parameters
NameTypeDefault
ignorebool—
ignore

Ignore the main texture/mask-derived minimum, default false. Does not select scaling behavior or remove CustomMinimumSize.

SetStretchModevoid
# SetStretchMode
C#
public void SetStretchMode(TextureButton.StretchModeEnum mode);

Drawing mode, default Keep. Scale stretches, Tile repeats, Keep/KeepCentered retain source size, KeepAspect variants retain proportions. Separately enable IgnoreTextureSize to shrink below intrinsic minimum.

Parameters
NameTypeDefault
modeTextureButton.StretchModeEnum—
mode

Drawing mode, default Keep. Scale stretches, Tile repeats, Keep/KeepCentered retain source size, KeepAspect variants retain proportions. Separately enable IgnoreTextureSize to shrink below intrinsic minimum.

SetTextureDisabledvoid
# SetTextureDisabled
C#
public void SetTextureDisabled(Texture2D texture);

Shared disabled-state Texture2D, or null. Falls back to Normal. Does not supply Control minimum or enable Disabled itself.

Parameters
NameTypeDefault
textureTexture2D—
texture

Shared disabled-state Texture2D, or null. Falls back to Normal. Does not supply Control minimum or enable Disabled itself.

SetTextureFocusedvoid
# SetTextureFocused
C#
public void SetTextureFocused(Texture2D texture);

Shared focus-overlay Texture2D, or null. Draws over the state; can be the sole image when others are absent. Does not supply Control minimum.

Parameters
NameTypeDefault
textureTexture2D—
texture

Shared focus-overlay Texture2D, or null. Draws over the state; can be the sole image when others are absent. Does not supply Control minimum.

SetTextureHovervoid
# SetTextureHover
C#
public void SetTextureHover(Texture2D texture);

Shared hover Texture2D, or null. Supplies minimum only without Normal and Pressed; absent hover can use Normal or a selected Pressed state.

Parameters
NameTypeDefault
textureTexture2D—
texture

Shared hover Texture2D, or null. Supplies minimum only without Normal and Pressed; absent hover can use Normal or a selected Pressed state.

SetTextureNormalvoid
# SetTextureNormal
C#
public void SetTextureNormal(Texture2D texture);

Base shared Texture2D, or null. First priority for minimum size even when other states are larger.

Parameters
NameTypeDefault
textureTexture2D—
texture

Base shared Texture2D, or null. First priority for minimum size even when other states are larger.

SetTexturePressedvoid
# SetTexturePressed
C#
public void SetTexturePressed(Texture2D texture);

Shared pressed-state Texture2D, or null. Falls back to Hover then Normal. Second minimum-size priority after Normal.

Parameters
NameTypeDefault
textureTexture2D—
texture

Shared pressed-state Texture2D, or null. Falls back to Hover then Normal. Second minimum-size priority after Normal.

TextureButton.StretchModeEnum

ValueDescription
Keep = 2

The texture keeps its original size and stays in the bounding rectangle's top-left corner.

KeepAspect = 4

Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.

KeepAspectCentered = 5

Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio.

KeepAspectCovered = 6

Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.

KeepCentered = 3

The texture keeps its original size and stays centered in the node's bounding rectangle.

Scale = 0

Scale to fit the node's bounding rectangle.

Tile = 1

Tile inside the node's bounding rectangle.

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.