AnimatedTexture

package
v0.0.0-...-b67d1b4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2025 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

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

type Instance

type Instance [1]gdclass.AnimatedTexture

[AnimatedTexture] is a resource format for frame-based animations, where multiple textures can be chained automatically with a predefined delay for each frame. Unlike [AnimationPlayer] or [AnimatedSprite2D], it isn't a [Node], but has the advantage of being usable anywhere a [Texture2D] resource can be used, e.g. in a [TileSet]. The playback of the animation is controlled by the [member speed_scale] property, as well as each frame's duration (see [method set_frame_duration]). The animation loops, i.e. it will restart at frame 0 automatically after playing the last frame. [AnimatedTexture] currently requires all frame textures to have the same size, otherwise the bigger ones will be cropped to match the smallest one. [b]Note:[/b] AnimatedTexture doesn't support using [AtlasTexture]s. Each frame needs to be a separate [Texture2D]. [b]Warning:[/b] The current implementation is not efficient for the modern renderers.

var Nil Instance

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

func New

func New() Instance

func (Instance) AsAnimatedTexture

func (self Instance) AsAnimatedTexture() Instance

func (Instance) AsObject

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

func (Instance) AsRefCounted

func (self Instance) AsRefCounted() [1]gd.RefCounted

func (Instance) AsResource

func (self Instance) AsResource() Resource.Instance

func (Instance) AsTexture

func (self Instance) AsTexture() Texture.Instance

func (Instance) AsTexture2D

func (self Instance) AsTexture2D() Texture2D.Instance

func (Instance) CurrentFrame

func (self Instance) CurrentFrame() int

func (Instance) Frames

func (self Instance) Frames() int

func (Instance) GetFrameDuration

func (self Instance) GetFrameDuration(frame_ int) Float.X

Returns the given [param frame]'s duration, in seconds.

func (Instance) GetFrameTexture

func (self Instance) GetFrameTexture(frame_ int) [1]gdclass.Texture2D

Returns the given frame's [Texture2D].

func (Instance) OneShot

func (self Instance) OneShot() bool

func (Instance) Pause

func (self Instance) Pause() bool

func (Instance) SetCurrentFrame

func (self Instance) SetCurrentFrame(value int)

func (Instance) SetFrameDuration

func (self Instance) SetFrameDuration(frame_ int, duration Float.X)

Sets the duration of any given [param frame]. The final duration is affected by the [member speed_scale]. If set to [code]0[/code], the frame is skipped during playback.

func (Instance) SetFrameTexture

func (self Instance) SetFrameTexture(frame_ int, texture [1]gdclass.Texture2D)

Assigns a [Texture2D] to the given frame. Frame IDs start at 0, so the first frame has ID 0, and the last frame of the animation has ID [member frames] - 1. You can define any number of textures up to [constant MAX_FRAMES], but keep in mind that only frames from 0 to [member frames] - 1 will be part of the animation.

func (Instance) SetFrames

func (self Instance) SetFrames(value int)

func (Instance) SetOneShot

func (self Instance) SetOneShot(value bool)

func (Instance) SetPause

func (self Instance) SetPause(value bool)

func (Instance) SetSpeedScale

func (self Instance) SetSpeedScale(value Float.X)

func (Instance) SpeedScale

func (self Instance) SpeedScale() Float.X

func (*Instance) UnsafePointer

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

func (Instance) Virtual

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

Jump to

Keyboard shortcuts

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