TextureButton

package
v0.0.0-...-a7442fb Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 13, 2025 License: MIT Imports: 28 Imported by: 0

Documentation

Overview

Package TextureButton provides methods for working with TextureButton object instances.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Advanced

type Advanced = class

Advanced exposes a 1:1 low-level instance of the class, undocumented, for those who know what they are doing.

type Any

type Any interface {
	gd.IsClass
	AsTextureButton() Instance
}

type Extension

type Extension[T gdclass.Interface] struct{ gdclass.Extension[T, Instance] }

Extension can be embedded in a new struct to create an extension of this class. T should be the type that is embedding this Extension

func (*Extension[T]) AsBaseButton

func (self *Extension[T]) AsBaseButton() BaseButton.Instance

func (*Extension[T]) AsCanvasItem

func (self *Extension[T]) AsCanvasItem() CanvasItem.Instance

func (*Extension[T]) AsControl

func (self *Extension[T]) AsControl() Control.Instance

func (*Extension[T]) AsNode

func (self *Extension[T]) AsNode() Node.Instance

func (*Extension[T]) AsObject

func (self *Extension[T]) AsObject() [1]gd.Object

func (*Extension[T]) AsTextureButton

func (self *Extension[T]) AsTextureButton() Instance

type ID

type ID Object.ID

ID is a typed object ID (reference) to an instance of this class, use it to store references to objects with unknown lifetimes, as an ID will not panic on use if the underlying object has been destroyed.

func (ID) Instance

func (id ID) Instance() (Instance, bool)

type Instance

type Instance [1]gdclass.TextureButton

[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 [Control]s. See also [BaseButton] which contains common properties and methods associated with this node. [b]Note:[/b] Setting a texture for the "normal" state ([member texture_normal]) is recommended. If [member texture_normal] is not set, the [TextureButton] will still receive input events and be clickable, but the user will not be able to see it unless they activate another one of its states with a texture assigned (e.g., hover over it to show [member texture_hover]).

var Nil Instance

Nil is a nil/null instance of the class. Equivalent to the zero value.

func New

func New() Instance

func (Instance) AsBaseButton

func (self Instance) AsBaseButton() BaseButton.Instance

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsControl

func (self Instance) AsControl() Control.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsObject

func (self Instance) AsObject() [1]gd.Object

func (Instance) AsTextureButton

func (self Instance) AsTextureButton() Instance

func (Instance) FlipH

func (self Instance) FlipH() bool

func (Instance) FlipV

func (self Instance) FlipV() bool

func (Instance) ID

func (self Instance) ID() ID

func (Instance) IgnoreTextureSize

func (self Instance) IgnoreTextureSize() bool

func (Instance) SetFlipH

func (self Instance) SetFlipH(value bool)

func (Instance) SetFlipV

func (self Instance) SetFlipV(value bool)

func (Instance) SetIgnoreTextureSize

func (self Instance) SetIgnoreTextureSize(value bool)

func (*Instance) SetObject

func (self *Instance) SetObject(obj [1]gd.Object) bool

func (Instance) SetStretchMode

func (self Instance) SetStretchMode(value StretchMode)

func (Instance) SetTextureClickMask

func (self Instance) SetTextureClickMask(value BitMap.Instance)

func (Instance) SetTextureDisabled

func (self Instance) SetTextureDisabled(value Texture2D.Instance)

func (Instance) SetTextureFocused

func (self Instance) SetTextureFocused(value Texture2D.Instance)

func (Instance) SetTextureHover

func (self Instance) SetTextureHover(value Texture2D.Instance)

func (Instance) SetTextureNormal

func (self Instance) SetTextureNormal(value Texture2D.Instance)

func (Instance) SetTexturePressed

func (self Instance) SetTexturePressed(value Texture2D.Instance)

func (Instance) StretchMode

func (self Instance) StretchMode() StretchMode

func (Instance) TextureClickMask

func (self Instance) TextureClickMask() BitMap.Instance

func (Instance) TextureDisabled

func (self Instance) TextureDisabled() Texture2D.Instance

func (Instance) TextureFocused

func (self Instance) TextureFocused() Texture2D.Instance

func (Instance) TextureHover

func (self Instance) TextureHover() Texture2D.Instance

func (Instance) TextureNormal

func (self Instance) TextureNormal() Texture2D.Instance

func (Instance) TexturePressed

func (self Instance) TexturePressed() Texture2D.Instance

func (Instance) Virtual

func (self Instance) Virtual(name string) reflect.Value

type StretchMode

type StretchMode int //gd:TextureButton.StretchMode
const (
	/*Scale to fit the node's bounding rectangle.*/
	StretchScale StretchMode = 0
	/*Tile inside the node's bounding rectangle.*/
	StretchTile StretchMode = 1
	/*The texture keeps its original size and stays in the bounding rectangle's top-left corner.*/
	StretchKeep StretchMode = 2
	/*The texture keeps its original size and stays centered in the node's bounding rectangle.*/
	StretchKeepCentered StretchMode = 3
	/*Scale the texture to fit the node's bounding rectangle, but maintain the texture's aspect ratio.*/
	StretchKeepAspect StretchMode = 4
	/*Scale the texture to fit the node's bounding rectangle, center it, and maintain its aspect ratio.*/
	StretchKeepAspectCentered StretchMode = 5
	/*Scale the texture so that the shorter side fits the bounding rectangle. The other side clips to the node's limits.*/
	StretchKeepAspectCovered StretchMode = 6
)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL