TextureButton

Texture-based button. Supports Pressed, Hover, Disabled and Focused states.

TextureButton has the same functionality as Button, except it uses sprites instead of Godot's Theme resource. It is faster to create, but it doesn't support localization like more complex Controls. The Normal state's texture is required. Others are optional.

@GodotBaseClass
struct TextureButton {}

Members

Aliases

BaseClasses
alias BaseClasses = AliasSeq!(typeof(_GODOT_base), typeof(_GODOT_base).BaseClasses)
Undocumented in source.

Enums

Constants
enum Constants
StretchMode
enum StretchMode

Functions

getClickMask
Ref!BitMap getClickMask()
getDisabledTexture
Ref!Texture getDisabledTexture()
getExpand
bool getExpand()
getFocusedTexture
Ref!Texture getFocusedTexture()
getHoverTexture
Ref!Texture getHoverTexture()
getNormalTexture
Ref!Texture getNormalTexture()
getPressedTexture
Ref!Texture getPressedTexture()
getStretchMode
TextureButton.StretchMode getStretchMode()
opAssign
TextureButton opAssign(T n)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(TextureButton other)
Undocumented in source. Be warned that the author may not have intended to support it.
opEquals
bool opEquals(typeof(null) n)
Undocumented in source. Be warned that the author may not have intended to support it.
setClickMask
void setClickMask(BitMap mask)
setDisabledTexture
void setDisabledTexture(Texture texture)
setExpand
void setExpand(bool p_expand)
setFocusedTexture
void setFocusedTexture(Texture texture)
setHoverTexture
void setHoverTexture(Texture texture)
setNormalTexture
void setNormalTexture(Texture texture)
setPressedTexture
void setPressedTexture(Texture texture)
setStretchMode
void setStretchMode(long p_mode)

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

expand
bool expand [@property setter]

If true the texture stretches to the edges of the node's bounding rectangle using the stretchMode. If false the texture will not scale with the node. Default value: false.

expand
bool expand [@property getter]

If true the texture stretches to the edges of the node's bounding rectangle using the stretchMode. If false the texture will not scale with the node. Default value: false.

stretchMode
TextureButton.StretchMode stretchMode [@property getter]
long stretchMode [@property setter]

Controls the texture's behavior when you resize the node's bounding rectangle, only if expand is true. Set it to one of the STRETCH_* constants. See the constants to learn more.

textureClickMask
BitMap textureClickMask [@property getter]
BitMap textureClickMask [@property setter]

Pure black and white Bitmap image to use for click detection. On the mask, white pixels represent the button's clickable area. Use it to create buttons with curved shapes.

textureDisabled
Texture textureDisabled [@property getter]
Texture textureDisabled [@property setter]

Texture to display when the node is disabled. See BaseButton.disabled.

textureFocused
Texture textureFocused [@property getter]
Texture textureFocused [@property setter]

Texture to display when the node has mouse or keyboard focus.

textureHover
Texture textureHover [@property getter]
Texture textureHover [@property setter]

Texture to display when the mouse hovers the node.

textureNormal
Texture textureNormal [@property getter]
Texture textureNormal [@property setter]

Texture to display by default, when the node is not in the disabled, focused, hover or pressed state.

texturePressed
Texture texturePressed [@property getter]
Texture texturePressed [@property setter]

Texture to display on mouse down over the node, if the node has keyboard focus and the player presses the enter key or if the player presses the BaseButton.shortcut key.

Static functions

_new
TextureButton _new()
Undocumented in source. Be warned that the author may not have intended to support it.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

_classBinding
struct _classBinding
Undocumented in source.

Unions

__anonymous
union __anonymous
Undocumented in source.

Variables

_GODOT_internal_name
enum string _GODOT_internal_name;
Undocumented in source.

Mixed In Members

From mixin baseCasts

as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
To as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
ToRef as()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(To)
Undocumented in source.
opCast
template opCast(ToRef)
Undocumented in source.
opCast
void* opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
godot_object opCast()
Undocumented in source. Be warned that the author may not have intended to support it.
opCast
bool opCast()
Undocumented in source. Be warned that the author may not have intended to support it.

Meta