TouchScreenButton

package
v0.0.0-...-d9f4d4e Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

Package TouchScreenButton provides methods for working with TouchScreenButton 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
	AsTouchScreenButton() Instance
}

type Instance

type Instance [1]gdclass.TouchScreenButton

TouchScreenButton allows you to create on-screen buttons for touch devices. It's intended for gameplay use, such as a unit you have to touch to move. Unlike [Button], TouchScreenButton supports multitouch out of the box. Several TouchScreenButtons can be pressed at the same time with touch input. This node inherits from [Node2D]. Unlike with [Control] nodes, you cannot set anchors on it. If you want to create menus or user interfaces, you may want to use [Button] nodes instead. To make button nodes react to touch events, you can enable the Emulate Mouse option in the Project Settings. You can configure TouchScreenButton to be visible only on touch devices, helping you develop your game both for desktop and mobile devices.

var Nil Instance

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

func New

func New() Instance

func (Instance) Action

func (self Instance) Action() string

func (Instance) AsCanvasItem

func (self Instance) AsCanvasItem() CanvasItem.Instance

func (Instance) AsNode

func (self Instance) AsNode() Node.Instance

func (Instance) AsNode2D

func (self Instance) AsNode2D() Node2D.Instance

func (Instance) AsObject

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

func (Instance) AsTouchScreenButton

func (self Instance) AsTouchScreenButton() Instance

func (Instance) Bitmask

func (self Instance) Bitmask() [1]gdclass.BitMap

func (Instance) IsPressed

func (self Instance) IsPressed() bool

Returns [code]true[/code] if this button is currently pressed.

func (Instance) OnPressed

func (self Instance) OnPressed(cb func())

func (Instance) OnReleased

func (self Instance) OnReleased(cb func())

func (Instance) PassbyPress

func (self Instance) PassbyPress() bool

func (Instance) SetAction

func (self Instance) SetAction(value string)

func (Instance) SetBitmask

func (self Instance) SetBitmask(value [1]gdclass.BitMap)

func (Instance) SetPassbyPress

func (self Instance) SetPassbyPress(value bool)

func (Instance) SetShape

func (self Instance) SetShape(value [1]gdclass.Shape2D)

func (Instance) SetShapeCentered

func (self Instance) SetShapeCentered(value bool)

func (Instance) SetShapeVisible

func (self Instance) SetShapeVisible(value bool)

func (Instance) SetTextureNormal

func (self Instance) SetTextureNormal(value [1]gdclass.Texture2D)

func (Instance) SetTexturePressed

func (self Instance) SetTexturePressed(value [1]gdclass.Texture2D)

func (Instance) SetVisibilityMode

func (self Instance) SetVisibilityMode(value gdclass.TouchScreenButtonVisibilityMode)

func (Instance) Shape

func (self Instance) Shape() [1]gdclass.Shape2D

func (Instance) ShapeCentered

func (self Instance) ShapeCentered() bool

func (Instance) ShapeVisible

func (self Instance) ShapeVisible() bool

func (Instance) TextureNormal

func (self Instance) TextureNormal() [1]gdclass.Texture2D

func (Instance) TexturePressed

func (self Instance) TexturePressed() [1]gdclass.Texture2D

func (*Instance) UnsafePointer

func (self *Instance) UnsafePointer() unsafe.Pointer

func (Instance) Virtual

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

func (Instance) VisibilityMode

func (self Instance) VisibilityMode() gdclass.TouchScreenButtonVisibilityMode

type VisibilityMode

type VisibilityMode = gdclass.TouchScreenButtonVisibilityMode //gd:TouchScreenButton.VisibilityMode
const (
	/*Always visible.*/
	VisibilityAlways VisibilityMode = 0
	/*Visible on touch screens only.*/
	VisibilityTouchscreenOnly VisibilityMode = 1
)

Jump to

Keyboard shortcuts

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