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 must contain a texture (textureNormal); other textures are optional. See also BaseButton which contains common properties and methods associated with this node.

@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
typeof(null) opAssign(typeof(null) n)
opEquals
bool opEquals(TextureButton other)
opEquals
bool opEquals(typeof(null) n)
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)
toHash
size_t toHash()

Mixins

__anonymous
mixin baseCasts
Undocumented in source.

Properties

expand
bool expand [@property getter]
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.

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 stretchmode 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()

Construct a new instance of TextureButton. Note: use memnew!TextureButton instead.

Static variables

_classBindingInitialized
bool _classBindingInitialized;
Undocumented in source.

Structs

GDNativeClassBinding
struct GDNativeClassBinding
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
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(To) as()
Undocumented in source. Be warned that the author may not have intended to support it.
as
inout(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