Documentation ¶
Overview ¶
Package AnimatedSprite3D provides methods for working with AnimatedSprite3D object instances.
Index ¶
- type Advanced
- type Any
- type Instance
- func (self Instance) Animation() string
- func (self Instance) AsAnimatedSprite3D() Instance
- func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance
- func (self Instance) AsNode() Node.Instance
- func (self Instance) AsNode3D() Node3D.Instance
- func (self Instance) AsObject() [1]gd.Object
- func (self Instance) AsSpriteBase3D() SpriteBase3D.Instance
- func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
- func (self Instance) Autoplay() string
- func (self Instance) Frame() int
- func (self Instance) FrameProgress() Float.X
- func (self Instance) GetPlayingSpeed() Float.X
- func (self Instance) IsPlaying() bool
- func (self Instance) OnAnimationChanged(cb func())
- func (self Instance) OnAnimationFinished(cb func())
- func (self Instance) OnAnimationLooped(cb func())
- func (self Instance) OnFrameChanged(cb func())
- func (self Instance) OnSpriteFramesChanged(cb func())
- func (self Instance) Pause()
- func (self Instance) Play()
- func (self Instance) PlayBackwards()
- func (self Instance) SetAnimation(value string)
- func (self Instance) SetAutoplay(value string)
- func (self Instance) SetFrame(value int)
- func (self Instance) SetFrameAndProgress(frame_ int, progress Float.X)
- func (self Instance) SetFrameProgress(value Float.X)
- func (self Instance) SetSpeedScale(value Float.X)
- func (self Instance) SetSpriteFrames(value [1]gdclass.SpriteFrames)
- func (self Instance) SpeedScale() Float.X
- func (self Instance) SpriteFrames() [1]gdclass.SpriteFrames
- func (self Instance) Stop()
- 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.AnimatedSprite3D
[AnimatedSprite3D] is similar to the [Sprite3D] node, except it carries multiple textures as animation [member sprite_frames]. Animations are created using a [SpriteFrames] resource, which allows you to import image files (or a folder containing said files) to provide the animation frames for the sprite. The [SpriteFrames] resource can be configured in the editor via the SpriteFrames bottom panel.
var Nil Instance
Nil is a nil/null instance of the class. Equivalent to the zero value.
func (Instance) AsAnimatedSprite3D ¶
func (Instance) AsGeometryInstance3D ¶
func (self Instance) AsGeometryInstance3D() GeometryInstance3D.Instance
func (Instance) AsSpriteBase3D ¶
func (self Instance) AsSpriteBase3D() SpriteBase3D.Instance
func (Instance) AsVisualInstance3D ¶
func (self Instance) AsVisualInstance3D() VisualInstance3D.Instance
func (Instance) FrameProgress ¶
func (Instance) GetPlayingSpeed ¶
Returns the actual playing speed of current animation or [code]0[/code] if not playing. This speed is the [member speed_scale] property multiplied by [code]custom_speed[/code] argument specified when calling the [method play] method. Returns a negative value if the current animation is playing backwards.
func (Instance) IsPlaying ¶
Returns [code]true[/code] if an animation is currently playing (even if [member speed_scale] and/or [code]custom_speed[/code] are [code]0[/code]).
func (Instance) OnAnimationChanged ¶
func (self Instance) OnAnimationChanged(cb func())
func (Instance) OnAnimationFinished ¶
func (self Instance) OnAnimationFinished(cb func())
func (Instance) OnAnimationLooped ¶
func (self Instance) OnAnimationLooped(cb func())
func (Instance) OnFrameChanged ¶
func (self Instance) OnFrameChanged(cb func())
func (Instance) OnSpriteFramesChanged ¶
func (self Instance) OnSpriteFramesChanged(cb func())
func (Instance) Pause ¶
func (self Instance) Pause()
Pauses the currently playing animation. The [member frame] and [member frame_progress] will be kept and calling [method play] or [method play_backwards] without arguments will resume the animation from the current playback position. See also [method stop].
func (Instance) Play ¶
func (self Instance) Play()
Plays the animation with key [param name]. If [param custom_speed] is negative and [param from_end] is [code]true[/code], the animation will play backwards (which is equivalent to calling [method play_backwards]). If this method is called with that same animation [param name], or with no [param name] parameter, the assigned animation will resume playing if it was paused.
func (Instance) PlayBackwards ¶
func (self Instance) PlayBackwards()
Plays the animation with key [param name] in reverse. This method is a shorthand for [method play] with [code]custom_speed = -1.0[/code] and [code]from_end = true[/code], so see its description for more information.
func (Instance) SetAnimation ¶
func (Instance) SetAutoplay ¶
func (Instance) SetFrameAndProgress ¶
The setter of [member frame] resets the [member frame_progress] to [code]0.0[/code] implicitly, but this method avoids that. This is useful when you want to carry over the current [member frame_progress] to another [member frame]. [b]Example:[/b] [codeblocks] [gdscript] # Change the animation with keeping the frame index and progress. var current_frame = animated_sprite.get_frame() var current_progress = animated_sprite.get_frame_progress() animated_sprite.play("walk_another_skin") animated_sprite.set_frame_and_progress(current_frame, current_progress) [/gdscript] [/codeblocks]
func (Instance) SetFrameProgress ¶
func (Instance) SetSpeedScale ¶
func (Instance) SetSpriteFrames ¶
func (self Instance) SetSpriteFrames(value [1]gdclass.SpriteFrames)
func (Instance) SpeedScale ¶
func (Instance) SpriteFrames ¶
func (self Instance) SpriteFrames() [1]gdclass.SpriteFrames
func (Instance) Stop ¶
func (self Instance) Stop()
Stops the currently playing animation. The animation position is reset to [code]0[/code] and the [code]custom_speed[/code] is reset to [code]1.0[/code]. See also [method pause].