Documentation
¶
Overview ¶
Package AnimatedTexture provides methods for working with AnimatedTexture object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) AsAnimatedTexture() Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsRefCounted() [1]gd.RefCounted
- func (self Instance) AsResource() Resource.Instance
- func (self Instance) AsTexture() Texture.Instance
- func (self Instance) AsTexture2D() Texture2D.Instance
- func (self Instance) CurrentFrame() int
- func (self Instance) Frames() int
- func (self Instance) GetFrameDuration(frame_ int) Float.X
- func (self Instance) GetFrameTexture(frame_ int) [1]gdclass.Texture2D
- func (self Instance) OneShot() bool
- func (self Instance) Pause() bool
- func (self Instance) SetCurrentFrame(value int)
- func (self Instance) SetFrameDuration(frame_ int, duration Float.X)
- func (self Instance) SetFrameTexture(frame_ int, texture [1]gdclass.Texture2D)
- func (self Instance) SetFrames(value int)
- func (self Instance) SetOneShot(value bool)
- func (self Instance) SetPause(value bool)
- func (self Instance) SetSpeedScale(value Float.X)
- func (self Instance) SpeedScale() Float.X
- func (self *Instance) UnsafePointer() unsafe.Pointer
- func (self Instance) Virtual(name string) reflect.Value
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 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 (Instance) AsAnimatedTexture ¶
func (Instance) AsRefCounted ¶
func (self Instance) AsRefCounted() [1]gd.RefCounted
func (Instance) AsResource ¶
func (Instance) AsTexture2D ¶
func (Instance) CurrentFrame ¶
func (Instance) GetFrameDuration ¶
Returns the given [param frame]'s duration, in seconds.
func (Instance) GetFrameTexture ¶
Returns the given frame's [Texture2D].
func (Instance) SetCurrentFrame ¶
func (Instance) SetFrameDuration ¶
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 ¶
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.